Здравствуйте, szag, Вы писали:
CS>>Тогда создание плагина это просто загрузка DLL/SO и вызов этой функции с соотв. interface_id.
CS>>Ну т.е. сделать для себя простой такой COM со всеми нужными bells & whistles.
S>Никто и не спорит что все это можно сделать самому
я спросил, может есть что-то готовое. Что-то, к чему можно дописать своих CS> bells & whistles.
Есть свое. Могу, наверно, даже дать попробовать.
Что есть:
IDL и генератор для C/C++. Генератор также генерит обертки для C++ (довольно стабилен

);
Компоненты (наборы компонент) собираются в dll/.so и сканируются при старте либо перебором dll'ек, либо считывается из кеша — в релизе, что убирает тормоза, которые имеют место при сканировании. Для создания кеша есть тулза

;
Каталоги и файлы можно исключать из обработки (сканирования), что позволяет таскать с собой Qt/Wx и не иметь конфликтов;
Есть утилита — визард для создания компонентов (Win32, бывает, ее клинит

)
Есть утилита — анализатор XML и генератор биндинга для C++ структур (вообще кривая

)
Ну и еще пяток утилит по мелочам
Библиотека на GUI не завязана, и не требует Qt, WxWidgets, и подобного, но есть кое-какие привязки к этим библиотекам:
довольно бедный, но универсальный интерфейс iDrawContext (WinGDI/wx/Qt);
iMenuBuilder — нечто централизованное, что хранит ассоциации: Имя->Обработчик, ИмяМеню->СписокКомандИ/ИлиПодменю — и строит по ним меню (wx/Win, Qt-шное отстает);
простенькая либа ввода-вывода — iIStream/iOStream/iIOStream —
file:///...,
tcp://host:port,
serial://localhost/com1|serial0 и тп, расширяемая без влезания во внутренности;
Поддержка ресурсов (строк и сообщений), сейчас — во внешних файлах, есть мысль добавить возможность "зашивать" в exe;
форматирование строк — по типу как в FormatMessage, но безопаснее, при помощи iArgList, с возможностью расширения форматеров (есть std форматирование, есть кастомные форматеры времени-даты, широты-долготы-угла);
биндинг С++ к XML — движки pugiXML, tinyXML, libxml2, планирую добавить msxml и qt;
разбор параметров командной строки в стиле GNU getopt, с использованием C++;
Поддерживается gcc, msvc. Тестировалось под Win32 и Linux (Debian 4).
На следующей неделе причешу, смогу выдать.
Выдам пока комплект библиотек, хидеры и собранные тулзы, на посмотреть; в любом случае, не для коммерческого использования.
В дальнейшем я хочу этот проект двинуть в народ, но пока обещать ничего не могу и не буду.
Документации нет, сайта нет, службы поддержки нет, списка "стандартных" компонент нет, я помогу, если что, но много помощи не обещаю
Пример использования
#define DUMP_PARSING_DATA_CMDID ((CLI_GETOPT_FIRST_CMDID)+1)
using ::cli::cmd_line::optFlag;
using ::cli::cmd_line::optValueOptional;
using ::cli::cmd_line::optValueRequired;
using ::cli::cmd_line::optRequiredOption;
::cli::cmd_line::COptDescription programmCmdOpts[] =
{ { L'h' , L"help" , optFlag , 0, L"print this help string." }
, { L'V' , L"version" , optFlag , 0, L"print program version number." }
, { CLI_GETOPT_WHERE_CMDID , L"where" , optFlag , 0, L"print program path and executable file name." }
, { CLI_GETOPT_WHERE_CMDID , L"where-is" , optFlag , 0, L"same as '--where'." }
, { CLI_GETOPT_WHERE_CMDID , L"where-is-it" , optFlag , 0, L"same as '--where'." }
, { DUMP_PARSING_DATA_CMDID , L"dump-xml-parsing-info",optFlag , 0
, L"dump all internal collected information about given xml."
}
};
bool dumpInfo = false;
::std::wstring fileName;
struct COptionHandler : public ::cli::cmd_line::COptionHandlerBase
{
bool operator()( const ::cli::cmd_line::CGetoptContext &ctx
, wchar_t optSelector
, const ::cli::cmd_line::COptDescription *pOptInfo
, ::cli::CiArgList &argList
) const
{
switch(optSelector)
{
case 0:
{
argList.getString( ctx.valueIndex, fileName);
break;
}
case DUMP_PARSING_DATA_CMDID:
dumpInfo = true;
break;
default : return ::cli::cmd_line::COptionHandlerBase::operator()( ctx, optSelector, pOptInfo, argList );
}
return true;
}
};
CLI_MAIN()
{
::cli::cmd_line::CGetoptContext getoptContext( L"test", L"file.xml", L"DoSomethig programm.", L"DoSomething 1.0" );
getoptContext.pOs = & ::std::cout;
getoptContext.pOsErr = & ::std::cerr;
if (!::cli::cmd_line::getoptParse( argList, programmCmdOpts, getoptContext, COptionHandler(), ::cli::cmd_line::gfAllowLongOptAliases ) )
return EC_COMMAND_LINE_PARSING_STOPPED;
// Где-то реализован компонент my/component/implemets/atest/iTestBase/andOthers
// Используем его
// Разбор ком-строки игнорируем, он для массы приведен ;)
atest::iTestBase test("my/component/implemets/atest/iTestBase/andOthers");
test.strBase[0][0] = ::std::wstring(L"Some str");
//atest::iTestEx testEx("my/component/implemets/atest/iTestBase/andOthers");
atest::iTestEx testEx; test.queryInterface(testEx);
testEx.strEx[0] = ::std::wstring(L"Some ex str");
//atest::iTestAnotherEx testAnotherEx("my/component/implemets/atest/iTestBase/andOthers");
atest::iTestEx testAnotherEx; test.queryInterface(testAnotherEx);
testAnotherEx.doSomething(0);
return 0;
}
IDL
#ifndef CLI_ATEST_CIDL
#define CLI_ATEST_CIDL
#ifndef CLI_IUNKNOWN_CIDL
#include <cli/iunknown.cidl>
#endif
#ifndef CLI_IO_IOTYPES_CIDL
#include <cli/io/ioTypes.cidl>
#endif
namespace atest
{
[alias=AUN]
union AUnion
{
int a;
char b;
};
[alias=ASTRU]
struct AStruct
{
int a;
int b;
AUnion u;
};
interface iTestBase extends ::cli::iUnknown
{
[get,set] property string strBase[size_t][size_t];
[get,set] property ::atest::AStruct structSimple;
[get,set] property ::atest::AStruct structV1[size_t];
[get,set] property ::atest::AUnion structV2[size_t][size_t];
};
interface iTestEx extends iTestBase
{
[get,set] property string strEx[size_t];
};
interface iTestAnotherEx extends iTestBase
{
STDMETHOD(doSomething)( [in] size_t some );
//STDMETHOD(doSomething)( );
[get,set] property string strEx[size_t];
};
}; // atest
#endif // CLI_ATEST_CIDL
C++
#ifndef CLI_ATEST_H
#define CLI_ATEST_H
/* Warning! Automaticaly generated file, do not edit */
/* Add next line to your IDL code
cpp_include("<cli/atest.h>", CLI_ATEST_H);
*/
/* Add next lines to your C/C++ code
#ifndef CLI_ATEST_H
#include <cli/atest.h>
#endif
*/
/* Standard includes */
#ifndef CLI_CLI2BASE_H
#include <cli/cli2base.h>
#endif
#ifndef CLI_CLI2TYPES_H
#include <cli/cli2types.h>
#endif
#ifndef CLI_IIDOF_H
#include <cli/iidof.h>
#endif
#ifndef CLI_IFDEFS_H
#include <cli/ifdefs.h>
#endif
#ifndef CLI_CLIASSERT_H
#include <cli/cliassert.h>
#endif
#ifndef CLI_IUNKNOWN_H
#include <cli/iunknown.h>
#endif
#ifndef CLI_CLIEXCEPT_H
#include <cli/cliexcept.h>
#endif
#ifndef CLI_PROPERTY_H
#include <cli/property.h>
#endif
#ifndef CLI_CLIPTR_H
#include <cli/cliptr.h>
#endif
#ifndef CLI_CLISTR_H
#include <cli/clistr.h>
#endif
/* User defined includes */
#ifndef CLI_PODTYPES_H
#include <cli/podTypes.h>
#endif
#ifndef CLI_THREADS_H
#include <cli/threads.h>
#endif
#ifndef CLI_IO_IOTYPES_H
#include <cli/io/ioTypes.h>
#endif
/* ------------------------------------------------------ */
/* Union: ::atest::AUnion */
/* ------------------------------------------------------ */
#ifdef CLI_UNION_NAME
#undef CLI_UNION_NAME
#endif
#if defined(__cplusplus) && !defined(CINTERFACE)
namespace atest {
#define CLI_UNION_NAME AUnion
#ifndef UNION_ATEST_AUNION_PREDECLARED
#define UNION_ATEST_AUNION_PREDECLARED
struct AUnion;
#ifndef UNION_ATEST_AUNION
#define UNION_ATEST_AUNION ::atest::AUnion
#endif
#ifndef UNION_ATEST_AUN
#define UNION_ATEST_AUN ::atest::AUN
#endif
typedef UNION_ATEST_AUNION AUN;
#endif // UNION_ATEST_AUNION_PREDECLARED
#else /* C-like declarations */
#define CLI_UNION_NAME atest_AUnion
#ifndef UNION_ATEST_AUNION_PREDECLARED
#define UNION_ATEST_AUNION_PREDECLARED
struct tag_atest_AUnion;
typedef struct tag_atest_AUnion atest_AUnion;
#ifndef UNION_ATEST_AUNION
#define UNION_ATEST_AUNION struct tag_atest_AUnion
#endif
#ifndef UNION_ATEST_AUN
#define UNION_ATEST_AUN atest_AUN
#endif
typedef UNION_ATEST_AUNION atest_AUN;
#endif // UNION_ATEST_AUNION_PREDECLARED
#endif /* end of C-like declarations */
#ifndef UNION_ATEST_AUNION_DEFINED
#define UNION_ATEST_AUNION_DEFINED
CLI_BEGIN_UNION_DECLARATION(CLI_UNION_NAME)
INT a;
CHAR b;
CLI_END_UNION_DECLARATION(CLI_UNION_NAME);
#endif // UNION_ATEST_AUNION_DEFINED
#if defined(__cplusplus) && !defined(CINTERFACE)
}; // namespace atest
#endif
/* ------------------------------------------------------ */
/* Struct: ::atest::AStruct */
/* ------------------------------------------------------ */
#ifdef CLI_STRUCT_NAME
#undef CLI_STRUCT_NAME
#endif
#if defined(__cplusplus) && !defined(CINTERFACE)
namespace atest {
#define CLI_STRUCT_NAME AStruct
#ifndef STRUCT_ATEST_ASTRUCT_PREDECLARED
#define STRUCT_ATEST_ASTRUCT_PREDECLARED
struct AStruct;
#ifndef STRUCT_ATEST_ASTRUCT
#define STRUCT_ATEST_ASTRUCT ::atest::AStruct
#endif
#ifndef STRUCT_ATEST_ASTRU
#define STRUCT_ATEST_ASTRU ::atest::ASTRU
#endif
typedef STRUCT_ATEST_ASTRUCT ASTRU;
#endif // STRUCT_ATEST_ASTRUCT_PREDECLARED
#else /* C-like declarations */
#define CLI_STRUCT_NAME atest_AStruct
#ifndef STRUCT_ATEST_ASTRUCT_PREDECLARED
#define STRUCT_ATEST_ASTRUCT_PREDECLARED
struct tag_atest_AStruct;
typedef struct tag_atest_AStruct atest_AStruct;
#ifndef STRUCT_ATEST_ASTRUCT
#define STRUCT_ATEST_ASTRUCT struct tag_atest_AStruct
#endif
#ifndef STRUCT_ATEST_ASTRU
#define STRUCT_ATEST_ASTRU atest_ASTRU
#endif
typedef STRUCT_ATEST_ASTRUCT atest_ASTRU;
#endif // STRUCT_ATEST_ASTRUCT_PREDECLARED
#endif /* end of C-like declarations */
#ifndef STRUCT_ATEST_ASTRUCT_DEFINED
#define STRUCT_ATEST_ASTRUCT_DEFINED
#include <cli/pshpack8.h>
CLI_BEGIN_STRUCT_DECLARATION(CLI_STRUCT_NAME)
INT a;
INT b;
UNION_ATEST_AUNION u;
CLI_END_STRUCT_DECLARATION(CLI_STRUCT_NAME);
#include <cli/poppack.h>
#endif // STRUCT_ATEST_ASTRUCT_DEFINED
#if defined(__cplusplus) && !defined(CINTERFACE)
}; // namespace atest
#endif
/* ------------------------------------------------------ */
/* Interface: ::atest::iTestBase */
/* ------------------------------------------------------ */
#if defined(__cplusplus) && !defined(CINTERFACE)
namespace cli {
interface iUnknown;
#ifndef INTERFACE_CLI_IUNKNOWN
#define INTERFACE_CLI_IUNKNOWN ::cli::iUnknown
#endif
}; // namespace cli
#else /* C-like declarations */
#ifndef INTERFACE_CLI_IUNKNOWN_PREDECLARED
#define INTERFACE_CLI_IUNKNOWN_PREDECLARED
typedef interface tag_cli_iUnknown cli_iUnknown;
#endif //INTERFACE_CLI_IUNKNOWN
#ifndef INTERFACE_CLI_IUNKNOWN
#define INTERFACE_CLI_IUNKNOWN struct tag_cli_iUnknown
#endif
#endif /* end of C-like declarations */
#ifdef INTERFACE
#undef INTERFACE
#endif
#ifdef BASE_INTERFACE
#undef BASE_INTERFACE
#endif
#ifndef INTERFACE_ATEST_ITESTBASE_IID
#define INTERFACE_ATEST_ITESTBASE_IID "/atest/iTestBase"
#endif
#if defined(__cplusplus) && !defined(CINTERFACE)
namespace atest {
#define INTERFACE iTestBase
#define BASE_INTERFACE ::cli::iUnknown
#ifndef INTERFACE_ATEST_ITESTBASE
#define INTERFACE_ATEST_ITESTBASE ::atest::iTestBase
#endif
#else /* C-like declaration */
#define INTERFACE atest_iTestBase
#define BASE_INTERFACE cli_iUnknown
#ifndef INTERFACE_ATEST_ITESTBASE
#define INTERFACE_ATEST_ITESTBASE atest_iTestBase
#endif
#endif
CLI_DECLARE_INTERFACE_(INTERFACE, BASE_INTERFACE)
{
/* interface ::cli::iUnknown methods */
CLIMETHOD(queryInterface) (THIS_ const CHAR* interfaceId /* [in] char* interfaceId */
, VOID** ifPtr /* [out] void* ifPtr */
) PURE;
CLIMETHOD_(ULONG, addRef) (THIS) PURE;
CLIMETHOD_(ULONG, release) (THIS) PURE;
/* interface ::atest::iTestBase methods */
CLIMETHOD(strBaseGet) (THIS_ CLISTR* _strBase
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
) PURE;
CLIMETHOD(strBaseSet) (THIS_ const CLISTR* _strBase
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
) PURE;
CLIMETHOD(strBaseSize1) (THIS_ SIZE_T* _size /* [out] size_t _size */) PURE;
CLIMETHOD(strBaseSize2) (THIS_ SIZE_T* _size /* [out] size_t _size */
, SIZE_T idx1 /* [in] size_t idx1 */
) PURE;
CLIMETHOD(structSimpleGet) (THIS_ STRUCT_ATEST_ASTRUCT* _structSimple /* [out] ::atest::AStruct _structSimple */) PURE;
CLIMETHOD(structSimpleSet) (THIS_ const STRUCT_ATEST_ASTRUCT* _structSimple /* [in,ref] ::atest::AStruct _structSimple */) PURE;
CLIMETHOD(structV1Get) (THIS_ STRUCT_ATEST_ASTRUCT* _structV1 /* [out] ::atest::AStruct _structV1 */
, SIZE_T idx1 /* [in] size_t idx1 */
) PURE;
CLIMETHOD(structV1Set) (THIS_ const STRUCT_ATEST_ASTRUCT* _structV1 /* [in,ref] ::atest::AStruct _structV1 */
, SIZE_T idx1 /* [in] size_t idx1 */
) PURE;
CLIMETHOD(structV1Size) (THIS_ SIZE_T* _size /* [out] size_t _size */) PURE;
CLIMETHOD(structV2Get) (THIS_ UNION_ATEST_AUNION* _structV2 /* [out] ::atest::AUnion _structV2 */
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
) PURE;
CLIMETHOD(structV2Set) (THIS_ const UNION_ATEST_AUNION* _structV2 /* [in,ref] ::atest::AUnion _structV2 */
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
) PURE;
CLIMETHOD(structV2Size1) (THIS_ SIZE_T* _size /* [out] size_t _size */) PURE;
CLIMETHOD(structV2Size2) (THIS_ SIZE_T* _size /* [out] size_t _size */
, SIZE_T idx1 /* [in] size_t idx1 */
) PURE;
};
#if defined(__cplusplus) && !defined(CINTERFACE)
}; // namespace atest
namespace cli{
template<> struct CIidOfImpl< ::atest::iTestBase >
{
static char const * getName() { return INTERFACE_ATEST_ITESTBASE_IID; }
};
template<> struct CIidOfImpl< ::atest::iTestBase* >
{
static char const * getName() { return CIidOfImpl< ::atest::iTestBase > :: getName(); }
};
}; // namespace cli
namespace atest {
// interface ::atest::iTestBase wrapper
// generated from F:\work\cli2\trunk\out\Win32\cidl\conf\templates\wrapper_template.cpp template file
template <
typename smartPtrType
/*
=
::cli::CCliPtr< INTERFACE_ATEST_ITESTBASE >
*/
>
class CiTestBaseWrapper
{
public:
typedef CiTestBaseWrapper< smartPtrType > wrapper_type;
typedef typename smartPtrType::interface_type interface_type;
typedef typename smartPtrType::interface_pointer_type interface_pointer_type;
typedef typename smartPtrType::pointer_type pointer_type;
protected:
// pointer to interface variable name
// allways must be pif - autogeneration depends on this name
smartPtrType pif;
public:
CiTestBaseWrapper() :
pif(0) {}
CiTestBaseWrapper( iTestBase *_pi, bool noAddRef=false) :
pif(_pi, noAddRef)
{ }
operator bool() const { return bool(pif); }
bool operator!() const { return pif.operator!(); }
interface_pointer_type* getPP() { return pif.getPP(); }
interface_pointer_type getIfPtr()
{
interface_pointer_type* ptrPtr = pif.getPP();
if (!ptrPtr) return 0;
return *ptrPtr;
}
void release()
{
pif.release();
}
CiTestBaseWrapper( const CHAR *componentId, INTERFACE_CLI_IUNKNOWN *pOuter=0) :
pif(0)
{
RCODE res = pif.createObject( componentId, pOuter );
if (RC_FAIL(res))
throw ::std::runtime_error("Failed to create requiested component");
}
CiTestBaseWrapper( const ::std::string &componentId, INTERFACE_CLI_IUNKNOWN *pOuter=0) :
pif(0)
{
if (componentId.empty())
throw ::std::runtime_error("Empty component name taken");
RCODE res = pif.createObject( componentId.c_str(), pOuter );
if (RC_FAIL(res))
throw ::std::runtime_error("Failed to create requiested component");
}
CiTestBaseWrapper( INTERFACE_CLI_IUNKNOWN *pUnk) :
pif(0)
{
::cli::CFoolishPtr<INTERFACE_CLI_IUNKNOWN> tmpPtr(pUnk);
RCODE res = tmpPtr.queryInterface(pif);
if (RC_FAIL(res))
throw ::std::runtime_error("Requested interface not supported by object");
}
CiTestBaseWrapper(const CiTestBaseWrapper &i) :
pif(i.pif) { }
~CiTestBaseWrapper() { }
CiTestBaseWrapper& operator=(const CiTestBaseWrapper &i)
{
if (&i!=this) pif = i.pif;
return *this;
}
template <typename T>
RCODE queryInterface( T **t)
{
return pif.queryInterface(t);
}
template <typename T>
RCODE queryInterface( T &t)
{
t.release();
return pif.queryInterface(t.getPP());
}
RCODE create(CHAR const * componentId, INTERFACE_CLI_IUNKNOWN *pOuter=0)
{
return pif.createObject(componentId, pOuter);
}
// Automaticaly generated methods code goes here
#if !defined(CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS)
::std::wstring get_strBase( SIZE_T idx1
, SIZE_T idx2
)
{
::std::wstring tmpVal;
RCODE res = strBaseGet( tmpVal, idx1, idx2);
CLI_CHECK_GET_PROPERTY_RESULT(res);
return tmpVal;
}
void set_strBase( SIZE_T idx1
, SIZE_T idx2
, const ::std::wstring &_strBase
)
{ // MS style - indeces are before value, need reorder
RCODE res = strBaseSet( _strBase, idx1, idx2 );
CLI_CHECK_SET_PROPERTY_RESULT(res);
}
SIZE_T size1_strBase( )
{
SIZE_T size;
RCODE res = strBaseSize1( &size );
CLI_CHECK_PROPERTY_SIZE_RESULT(res);
return size;
}
SIZE_T size2_strBase( SIZE_T idx1 )
{
SIZE_T size;
RCODE res = strBaseSize2( &size, idx1 );
CLI_CHECK_PROPERTY_SIZE_RESULT(res);
return size;
}
#if !defined(CLI_WRAPPER_NO_PROPERTIES)
/* GCC note: invalid access to non-static data member of NULL object warning must be ignored. This is known GCC "offsetof problem"
By default, special version of code used for GCC, use DISABLE_GCC_OFFSETOF_WARNING_WORKAROUND to switch off workaround and see this warning */
CLI_DECLARE_PROPERTY_RW_IDX2(wrapper_type, ::std::wstring, strBase, SIZE_T, SIZE_T );
#endif /* CLI_WRAPPER_NO_PROPERTIES */
#endif /* CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS */
RCODE strBaseGet( ::std::wstring &_strBase
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
)
{
CCliStr tmp__strBase; CCliStr_init( tmp__strBase );
RCODE res = pif->strBaseGet(&tmp__strBase, idx1, idx2);
if (RCOK(res))
{
CCliStr_copyFromIfModified( _strBase, tmp__strBase);
}
return res;
}
RCODE strBaseSet( const ::std::wstring &_strBase
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
)
{
CCliStr tmp__strBase; CCliStr_lightCopyTo( tmp__strBase, _strBase);
return pif->strBaseSet(&tmp__strBase, idx1, idx2);
}
RCODE strBaseSize1( SIZE_T* _size /* [out] size_t _size */)
{
return pif->strBaseSize1(_size);
}
RCODE strBaseSize2( SIZE_T* _size /* [out] size_t _size */
, SIZE_T idx1 /* [in] size_t idx1 */
)
{
return pif->strBaseSize2(_size, idx1);
}
#if !defined(CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS)
STRUCT_ATEST_ASTRUCT get_structSimple( )
{
STRUCT_ATEST_ASTRUCT tmpVal;
RCODE res = structSimpleGet( tmpVal);
CLI_CHECK_GET_PROPERTY_RESULT(res);
return tmpVal;
}
void set_structSimple( const STRUCT_ATEST_ASTRUCT &_structSimple
)
{
RCODE res = structSimpleSet( _structSimple );
CLI_CHECK_SET_PROPERTY_RESULT(res);
}
#if !defined(CLI_WRAPPER_NO_PROPERTIES)
/* GCC note: invalid access to non-static data member of NULL object warning must be ignored. This is known GCC "offsetof problem"
By default, special version of code used for GCC, use DISABLE_GCC_OFFSETOF_WARNING_WORKAROUND to switch off workaround and see this warning */
CLI_DECLARE_PROPERTY_RW(wrapper_type, STRUCT_ATEST_ASTRUCT, structSimple );
#endif /* CLI_WRAPPER_NO_PROPERTIES */
#endif /* CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS */
RCODE structSimpleGet( STRUCT_ATEST_ASTRUCT &_structSimple /* [out] ::atest::AStruct _structSimple (struct passed by ref in wrapper) */)
{
return pif->structSimpleGet(&_structSimple);
}
RCODE structSimpleSet( const STRUCT_ATEST_ASTRUCT &_structSimple /* [in,ref] ::atest::AStruct _structSimple (struct passed by ref in wrapper) */)
{
return pif->structSimpleSet(&_structSimple);
}
#if !defined(CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS)
STRUCT_ATEST_ASTRUCT get_structV1( SIZE_T idx1 )
{
STRUCT_ATEST_ASTRUCT tmpVal;
RCODE res = structV1Get( tmpVal, idx1);
CLI_CHECK_GET_PROPERTY_RESULT(res);
return tmpVal;
}
void set_structV1( SIZE_T idx1 , const STRUCT_ATEST_ASTRUCT &_structV1
)
{ // MS style - index goes before value, need reorder
RCODE res = structV1Set( _structV1, idx1 );
CLI_CHECK_SET_PROPERTY_RESULT(res);
}
SIZE_T size_structV1( )
{
SIZE_T size;
RCODE res = structV1Size( &size );
CLI_CHECK_PROPERTY_SIZE_RESULT(res);
return size;
}
#if !defined(CLI_WRAPPER_NO_PROPERTIES)
/* GCC note: invalid access to non-static data member of NULL object warning must be ignored. This is known GCC "offsetof problem"
By default, special version of code used for GCC, use DISABLE_GCC_OFFSETOF_WARNING_WORKAROUND to switch off workaround and see this warning */
CLI_DECLARE_PROPERTY_RW_IDX1(wrapper_type, STRUCT_ATEST_ASTRUCT, structV1, SIZE_T );
#endif /* CLI_WRAPPER_NO_PROPERTIES */
#endif /* CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS */
RCODE structV1Get( STRUCT_ATEST_ASTRUCT &_structV1 /* [out] ::atest::AStruct _structV1 (struct passed by ref in wrapper) */
, SIZE_T idx1 /* [in] size_t idx1 */
)
{
return pif->structV1Get(&_structV1, idx1);
}
RCODE structV1Set( const STRUCT_ATEST_ASTRUCT &_structV1 /* [in,ref] ::atest::AStruct _structV1 (struct passed by ref in wrapper) */
, SIZE_T idx1 /* [in] size_t idx1 */
)
{
return pif->structV1Set(&_structV1, idx1);
}
RCODE structV1Size( SIZE_T* _size /* [out] size_t _size */)
{
return pif->structV1Size(_size);
}
#if !defined(CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS)
UNION_ATEST_AUNION get_structV2( SIZE_T idx1
, SIZE_T idx2
)
{
UNION_ATEST_AUNION tmpVal;
RCODE res = structV2Get( &tmpVal, idx1, idx2);
CLI_CHECK_GET_PROPERTY_RESULT(res);
return tmpVal;
}
void set_structV2( SIZE_T idx1
, SIZE_T idx2
, UNION_ATEST_AUNION _structV2
)
{ // MS style - indeces are before value, need reorder
RCODE res = structV2Set( _structV2, idx1, idx2 );
CLI_CHECK_SET_PROPERTY_RESULT(res);
}
SIZE_T size1_structV2( )
{
SIZE_T size;
RCODE res = structV2Size1( &size );
CLI_CHECK_PROPERTY_SIZE_RESULT(res);
return size;
}
SIZE_T size2_structV2( SIZE_T idx1 )
{
SIZE_T size;
RCODE res = structV2Size2( &size, idx1 );
CLI_CHECK_PROPERTY_SIZE_RESULT(res);
return size;
}
#if !defined(CLI_WRAPPER_NO_PROPERTIES)
/* GCC note: invalid access to non-static data member of NULL object warning must be ignored. This is known GCC "offsetof problem"
By default, special version of code used for GCC, use DISABLE_GCC_OFFSETOF_WARNING_WORKAROUND to switch off workaround and see this warning */
CLI_DECLARE_PROPERTY_RW_IDX2(wrapper_type, UNION_ATEST_AUNION, structV2, SIZE_T, SIZE_T );
#endif /* CLI_WRAPPER_NO_PROPERTIES */
#endif /* CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS */
RCODE structV2Get( UNION_ATEST_AUNION &_structV2 /* [out] ::atest::AUnion _structV2 (struct passed by ref in wrapper) */
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
)
{
return pif->structV2Get(_structV2, idx1, idx2);
}
RCODE structV2Set( const UNION_ATEST_AUNION &_structV2 /* [in,ref] ::atest::AUnion _structV2 (struct passed by ref in wrapper) */
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
)
{
return pif->structV2Set(_structV2, idx1, idx2);
}
RCODE structV2Size1( SIZE_T* _size /* [out] size_t _size */)
{
return pif->structV2Size1(_size);
}
RCODE structV2Size2( SIZE_T* _size /* [out] size_t _size */
, SIZE_T idx1 /* [in] size_t idx1 */
)
{
return pif->structV2Size2(_size, idx1);
}
}; // class CiTestBaseWrapper
typedef CiTestBaseWrapper< ::cli::CCliPtr< INTERFACE_ATEST_ITESTBASE > > CiTestBase;
typedef CiTestBaseWrapper< ::cli::CFoolishPtr< INTERFACE_ATEST_ITESTBASE > > CiTestBase_nrc; /* No ref counting for interface used */
}; // namespace atest
#endif
/* ------------------------------------------------------ */
/* Interface: ::atest::iTestEx */
/* ------------------------------------------------------ */
#if defined(__cplusplus) && !defined(CINTERFACE)
namespace atest {
interface iTestBase;
#ifndef INTERFACE_ATEST_ITESTBASE
#define INTERFACE_ATEST_ITESTBASE ::atest::iTestBase
#endif
}; // namespace atest
#else /* C-like declarations */
#ifndef INTERFACE_ATEST_ITESTBASE_PREDECLARED
#define INTERFACE_ATEST_ITESTBASE_PREDECLARED
typedef interface tag_atest_iTestBase atest_iTestBase;
#endif //INTERFACE_ATEST_ITESTBASE
#ifndef INTERFACE_ATEST_ITESTBASE
#define INTERFACE_ATEST_ITESTBASE struct tag_atest_iTestBase
#endif
#endif /* end of C-like declarations */
#ifdef INTERFACE
#undef INTERFACE
#endif
#ifdef BASE_INTERFACE
#undef BASE_INTERFACE
#endif
#ifndef INTERFACE_ATEST_ITESTEX_IID
#define INTERFACE_ATEST_ITESTEX_IID "/atest/iTestEx"
#endif
#if defined(__cplusplus) && !defined(CINTERFACE)
namespace atest {
#define INTERFACE iTestEx
#define BASE_INTERFACE ::atest::iTestBase
#ifndef INTERFACE_ATEST_ITESTEX
#define INTERFACE_ATEST_ITESTEX ::atest::iTestEx
#endif
#else /* C-like declaration */
#define INTERFACE atest_iTestEx
#define BASE_INTERFACE atest_iTestBase
#ifndef INTERFACE_ATEST_ITESTEX
#define INTERFACE_ATEST_ITESTEX atest_iTestEx
#endif
#endif
CLI_DECLARE_INTERFACE_(INTERFACE, BASE_INTERFACE)
{
/* interface ::cli::iUnknown methods */
CLIMETHOD(queryInterface) (THIS_ const CHAR* interfaceId /* [in] char* interfaceId */
, VOID** ifPtr /* [out] void* ifPtr */
) PURE;
CLIMETHOD_(ULONG, addRef) (THIS) PURE;
CLIMETHOD_(ULONG, release) (THIS) PURE;
/* interface ::atest::iTestBase methods */
CLIMETHOD(strBaseGet) (THIS_ CLISTR* _strBase
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
) PURE;
CLIMETHOD(strBaseSet) (THIS_ const CLISTR* _strBase
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
) PURE;
CLIMETHOD(strBaseSize1) (THIS_ SIZE_T* _size /* [out] size_t _size */) PURE;
CLIMETHOD(strBaseSize2) (THIS_ SIZE_T* _size /* [out] size_t _size */
, SIZE_T idx1 /* [in] size_t idx1 */
) PURE;
CLIMETHOD(structSimpleGet) (THIS_ STRUCT_ATEST_ASTRUCT* _structSimple /* [out] ::atest::AStruct _structSimple */) PURE;
CLIMETHOD(structSimpleSet) (THIS_ const STRUCT_ATEST_ASTRUCT* _structSimple /* [in,ref] ::atest::AStruct _structSimple */) PURE;
CLIMETHOD(structV1Get) (THIS_ STRUCT_ATEST_ASTRUCT* _structV1 /* [out] ::atest::AStruct _structV1 */
, SIZE_T idx1 /* [in] size_t idx1 */
) PURE;
CLIMETHOD(structV1Set) (THIS_ const STRUCT_ATEST_ASTRUCT* _structV1 /* [in,ref] ::atest::AStruct _structV1 */
, SIZE_T idx1 /* [in] size_t idx1 */
) PURE;
CLIMETHOD(structV1Size) (THIS_ SIZE_T* _size /* [out] size_t _size */) PURE;
CLIMETHOD(structV2Get) (THIS_ UNION_ATEST_AUNION* _structV2 /* [out] ::atest::AUnion _structV2 */
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
) PURE;
CLIMETHOD(structV2Set) (THIS_ const UNION_ATEST_AUNION* _structV2 /* [in,ref] ::atest::AUnion _structV2 */
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
) PURE;
CLIMETHOD(structV2Size1) (THIS_ SIZE_T* _size /* [out] size_t _size */) PURE;
CLIMETHOD(structV2Size2) (THIS_ SIZE_T* _size /* [out] size_t _size */
, SIZE_T idx1 /* [in] size_t idx1 */
) PURE;
/* interface ::atest::iTestEx methods */
CLIMETHOD(strExGet) (THIS_ CLISTR* _strEx
, SIZE_T idx1 /* [in] size_t idx1 */
) PURE;
CLIMETHOD(strExSet) (THIS_ const CLISTR* _strEx
, SIZE_T idx1 /* [in] size_t idx1 */
) PURE;
CLIMETHOD(strExSize) (THIS_ SIZE_T* _size /* [out] size_t _size */) PURE;
};
#if defined(__cplusplus) && !defined(CINTERFACE)
}; // namespace atest
namespace cli{
template<> struct CIidOfImpl< ::atest::iTestEx >
{
static char const * getName() { return INTERFACE_ATEST_ITESTEX_IID; }
};
template<> struct CIidOfImpl< ::atest::iTestEx* >
{
static char const * getName() { return CIidOfImpl< ::atest::iTestEx > :: getName(); }
};
}; // namespace cli
namespace atest {
// interface ::atest::iTestEx wrapper
// generated from F:\work\cli2\trunk\out\Win32\cidl\conf\templates\wrapper_template.cpp template file
template <
typename smartPtrType
/*
=
::cli::CCliPtr< INTERFACE_ATEST_ITESTEX >
*/
>
class CiTestExWrapper
{
public:
typedef CiTestExWrapper< smartPtrType > wrapper_type;
typedef typename smartPtrType::interface_type interface_type;
typedef typename smartPtrType::interface_pointer_type interface_pointer_type;
typedef typename smartPtrType::pointer_type pointer_type;
protected:
// pointer to interface variable name
// allways must be pif - autogeneration depends on this name
smartPtrType pif;
public:
CiTestExWrapper() :
pif(0) {}
CiTestExWrapper( iTestEx *_pi, bool noAddRef=false) :
pif(_pi, noAddRef)
{ }
operator bool() const { return bool(pif); }
bool operator!() const { return pif.operator!(); }
interface_pointer_type* getPP() { return pif.getPP(); }
interface_pointer_type getIfPtr()
{
interface_pointer_type* ptrPtr = pif.getPP();
if (!ptrPtr) return 0;
return *ptrPtr;
}
void release()
{
pif.release();
}
CiTestExWrapper( const CHAR *componentId, INTERFACE_CLI_IUNKNOWN *pOuter=0) :
pif(0)
{
RCODE res = pif.createObject( componentId, pOuter );
if (RC_FAIL(res))
throw ::std::runtime_error("Failed to create requiested component");
}
CiTestExWrapper( const ::std::string &componentId, INTERFACE_CLI_IUNKNOWN *pOuter=0) :
pif(0)
{
if (componentId.empty())
throw ::std::runtime_error("Empty component name taken");
RCODE res = pif.createObject( componentId.c_str(), pOuter );
if (RC_FAIL(res))
throw ::std::runtime_error("Failed to create requiested component");
}
CiTestExWrapper( INTERFACE_CLI_IUNKNOWN *pUnk) :
pif(0)
{
::cli::CFoolishPtr<INTERFACE_CLI_IUNKNOWN> tmpPtr(pUnk);
RCODE res = tmpPtr.queryInterface(pif);
if (RC_FAIL(res))
throw ::std::runtime_error("Requested interface not supported by object");
}
CiTestExWrapper(const CiTestExWrapper &i) :
pif(i.pif) { }
~CiTestExWrapper() { }
CiTestExWrapper& operator=(const CiTestExWrapper &i)
{
if (&i!=this) pif = i.pif;
return *this;
}
template <typename T>
RCODE queryInterface( T **t)
{
return pif.queryInterface(t);
}
template <typename T>
RCODE queryInterface( T &t)
{
t.release();
return pif.queryInterface(t.getPP());
}
RCODE create(CHAR const * componentId, INTERFACE_CLI_IUNKNOWN *pOuter=0)
{
return pif.createObject(componentId, pOuter);
}
// Automaticaly generated methods code goes here
#if !defined(CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS)
::std::wstring get_strBase( SIZE_T idx1
, SIZE_T idx2
)
{
::std::wstring tmpVal;
RCODE res = strBaseGet( tmpVal, idx1, idx2);
CLI_CHECK_GET_PROPERTY_RESULT(res);
return tmpVal;
}
void set_strBase( SIZE_T idx1
, SIZE_T idx2
, const ::std::wstring &_strBase
)
{ // MS style - indeces are before value, need reorder
RCODE res = strBaseSet( _strBase, idx1, idx2 );
CLI_CHECK_SET_PROPERTY_RESULT(res);
}
SIZE_T size1_strBase( )
{
SIZE_T size;
RCODE res = strBaseSize1( &size );
CLI_CHECK_PROPERTY_SIZE_RESULT(res);
return size;
}
SIZE_T size2_strBase( SIZE_T idx1 )
{
SIZE_T size;
RCODE res = strBaseSize2( &size, idx1 );
CLI_CHECK_PROPERTY_SIZE_RESULT(res);
return size;
}
#if !defined(CLI_WRAPPER_NO_PROPERTIES)
/* GCC note: invalid access to non-static data member of NULL object warning must be ignored. This is known GCC "offsetof problem"
By default, special version of code used for GCC, use DISABLE_GCC_OFFSETOF_WARNING_WORKAROUND to switch off workaround and see this warning */
CLI_DECLARE_PROPERTY_RW_IDX2(wrapper_type, ::std::wstring, strBase, SIZE_T, SIZE_T );
#endif /* CLI_WRAPPER_NO_PROPERTIES */
#endif /* CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS */
RCODE strBaseGet( ::std::wstring &_strBase
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
)
{
CCliStr tmp__strBase; CCliStr_init( tmp__strBase );
RCODE res = pif->strBaseGet(&tmp__strBase, idx1, idx2);
if (RCOK(res))
{
CCliStr_copyFromIfModified( _strBase, tmp__strBase);
}
return res;
}
RCODE strBaseSet( const ::std::wstring &_strBase
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
)
{
CCliStr tmp__strBase; CCliStr_lightCopyTo( tmp__strBase, _strBase);
return pif->strBaseSet(&tmp__strBase, idx1, idx2);
}
RCODE strBaseSize1( SIZE_T* _size /* [out] size_t _size */)
{
return pif->strBaseSize1(_size);
}
RCODE strBaseSize2( SIZE_T* _size /* [out] size_t _size */
, SIZE_T idx1 /* [in] size_t idx1 */
)
{
return pif->strBaseSize2(_size, idx1);
}
#if !defined(CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS)
STRUCT_ATEST_ASTRUCT get_structSimple( )
{
STRUCT_ATEST_ASTRUCT tmpVal;
RCODE res = structSimpleGet( tmpVal);
CLI_CHECK_GET_PROPERTY_RESULT(res);
return tmpVal;
}
void set_structSimple( const STRUCT_ATEST_ASTRUCT &_structSimple
)
{
RCODE res = structSimpleSet( _structSimple );
CLI_CHECK_SET_PROPERTY_RESULT(res);
}
#if !defined(CLI_WRAPPER_NO_PROPERTIES)
/* GCC note: invalid access to non-static data member of NULL object warning must be ignored. This is known GCC "offsetof problem"
By default, special version of code used for GCC, use DISABLE_GCC_OFFSETOF_WARNING_WORKAROUND to switch off workaround and see this warning */
CLI_DECLARE_PROPERTY_RW(wrapper_type, STRUCT_ATEST_ASTRUCT, structSimple );
#endif /* CLI_WRAPPER_NO_PROPERTIES */
#endif /* CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS */
RCODE structSimpleGet( STRUCT_ATEST_ASTRUCT &_structSimple /* [out] ::atest::AStruct _structSimple (struct passed by ref in wrapper) */)
{
return pif->structSimpleGet(&_structSimple);
}
RCODE structSimpleSet( const STRUCT_ATEST_ASTRUCT &_structSimple /* [in,ref] ::atest::AStruct _structSimple (struct passed by ref in wrapper) */)
{
return pif->structSimpleSet(&_structSimple);
}
#if !defined(CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS)
STRUCT_ATEST_ASTRUCT get_structV1( SIZE_T idx1 )
{
STRUCT_ATEST_ASTRUCT tmpVal;
RCODE res = structV1Get( tmpVal, idx1);
CLI_CHECK_GET_PROPERTY_RESULT(res);
return tmpVal;
}
void set_structV1( SIZE_T idx1 , const STRUCT_ATEST_ASTRUCT &_structV1
)
{ // MS style - index goes before value, need reorder
RCODE res = structV1Set( _structV1, idx1 );
CLI_CHECK_SET_PROPERTY_RESULT(res);
}
SIZE_T size_structV1( )
{
SIZE_T size;
RCODE res = structV1Size( &size );
CLI_CHECK_PROPERTY_SIZE_RESULT(res);
return size;
}
#if !defined(CLI_WRAPPER_NO_PROPERTIES)
/* GCC note: invalid access to non-static data member of NULL object warning must be ignored. This is known GCC "offsetof problem"
By default, special version of code used for GCC, use DISABLE_GCC_OFFSETOF_WARNING_WORKAROUND to switch off workaround and see this warning */
CLI_DECLARE_PROPERTY_RW_IDX1(wrapper_type, STRUCT_ATEST_ASTRUCT, structV1, SIZE_T );
#endif /* CLI_WRAPPER_NO_PROPERTIES */
#endif /* CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS */
RCODE structV1Get( STRUCT_ATEST_ASTRUCT &_structV1 /* [out] ::atest::AStruct _structV1 (struct passed by ref in wrapper) */
, SIZE_T idx1 /* [in] size_t idx1 */
)
{
return pif->structV1Get(&_structV1, idx1);
}
RCODE structV1Set( const STRUCT_ATEST_ASTRUCT &_structV1 /* [in,ref] ::atest::AStruct _structV1 (struct passed by ref in wrapper) */
, SIZE_T idx1 /* [in] size_t idx1 */
)
{
return pif->structV1Set(&_structV1, idx1);
}
RCODE structV1Size( SIZE_T* _size /* [out] size_t _size */)
{
return pif->structV1Size(_size);
}
#if !defined(CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS)
UNION_ATEST_AUNION get_structV2( SIZE_T idx1
, SIZE_T idx2
)
{
UNION_ATEST_AUNION tmpVal;
RCODE res = structV2Get( &tmpVal, idx1, idx2);
CLI_CHECK_GET_PROPERTY_RESULT(res);
return tmpVal;
}
void set_structV2( SIZE_T idx1
, SIZE_T idx2
, UNION_ATEST_AUNION _structV2
)
{ // MS style - indeces are before value, need reorder
RCODE res = structV2Set( _structV2, idx1, idx2 );
CLI_CHECK_SET_PROPERTY_RESULT(res);
}
SIZE_T size1_structV2( )
{
SIZE_T size;
RCODE res = structV2Size1( &size );
CLI_CHECK_PROPERTY_SIZE_RESULT(res);
return size;
}
SIZE_T size2_structV2( SIZE_T idx1 )
{
SIZE_T size;
RCODE res = structV2Size2( &size, idx1 );
CLI_CHECK_PROPERTY_SIZE_RESULT(res);
return size;
}
#if !defined(CLI_WRAPPER_NO_PROPERTIES)
/* GCC note: invalid access to non-static data member of NULL object warning must be ignored. This is known GCC "offsetof problem"
By default, special version of code used for GCC, use DISABLE_GCC_OFFSETOF_WARNING_WORKAROUND to switch off workaround and see this warning */
CLI_DECLARE_PROPERTY_RW_IDX2(wrapper_type, UNION_ATEST_AUNION, structV2, SIZE_T, SIZE_T );
#endif /* CLI_WRAPPER_NO_PROPERTIES */
#endif /* CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS */
RCODE structV2Get( UNION_ATEST_AUNION &_structV2 /* [out] ::atest::AUnion _structV2 (struct passed by ref in wrapper) */
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
)
{
return pif->structV2Get(_structV2, idx1, idx2);
}
RCODE structV2Set( const UNION_ATEST_AUNION &_structV2 /* [in,ref] ::atest::AUnion _structV2 (struct passed by ref in wrapper) */
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
)
{
return pif->structV2Set(_structV2, idx1, idx2);
}
RCODE structV2Size1( SIZE_T* _size /* [out] size_t _size */)
{
return pif->structV2Size1(_size);
}
RCODE structV2Size2( SIZE_T* _size /* [out] size_t _size */
, SIZE_T idx1 /* [in] size_t idx1 */
)
{
return pif->structV2Size2(_size, idx1);
}
#if !defined(CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS)
::std::wstring get_strEx( SIZE_T idx1 )
{
::std::wstring tmpVal;
RCODE res = strExGet( tmpVal, idx1);
CLI_CHECK_GET_PROPERTY_RESULT(res);
return tmpVal;
}
void set_strEx( SIZE_T idx1 , const ::std::wstring &_strEx
)
{ // MS style - index goes before value, need reorder
RCODE res = strExSet( _strEx, idx1 );
CLI_CHECK_SET_PROPERTY_RESULT(res);
}
SIZE_T size_strEx( )
{
SIZE_T size;
RCODE res = strExSize( &size );
CLI_CHECK_PROPERTY_SIZE_RESULT(res);
return size;
}
#if !defined(CLI_WRAPPER_NO_PROPERTIES)
/* GCC note: invalid access to non-static data member of NULL object warning must be ignored. This is known GCC "offsetof problem"
By default, special version of code used for GCC, use DISABLE_GCC_OFFSETOF_WARNING_WORKAROUND to switch off workaround and see this warning */
CLI_DECLARE_PROPERTY_RW_IDX1(wrapper_type, ::std::wstring, strEx, SIZE_T );
#endif /* CLI_WRAPPER_NO_PROPERTIES */
#endif /* CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS */
RCODE strExGet( ::std::wstring &_strEx
, SIZE_T idx1 /* [in] size_t idx1 */
)
{
CCliStr tmp__strEx; CCliStr_init( tmp__strEx );
RCODE res = pif->strExGet(&tmp__strEx, idx1);
if (RCOK(res))
{
CCliStr_copyFromIfModified( _strEx, tmp__strEx);
}
return res;
}
RCODE strExSet( const ::std::wstring &_strEx
, SIZE_T idx1 /* [in] size_t idx1 */
)
{
CCliStr tmp__strEx; CCliStr_lightCopyTo( tmp__strEx, _strEx);
return pif->strExSet(&tmp__strEx, idx1);
}
RCODE strExSize( SIZE_T* _size /* [out] size_t _size */)
{
return pif->strExSize(_size);
}
}; // class CiTestExWrapper
typedef CiTestExWrapper< ::cli::CCliPtr< INTERFACE_ATEST_ITESTEX > > CiTestEx;
typedef CiTestExWrapper< ::cli::CFoolishPtr< INTERFACE_ATEST_ITESTEX > > CiTestEx_nrc; /* No ref counting for interface used */
}; // namespace atest
#endif
/* ------------------------------------------------------ */
/* Interface: ::atest::iTestAnotherEx */
/* ------------------------------------------------------ */
#ifdef INTERFACE
#undef INTERFACE
#endif
#ifdef BASE_INTERFACE
#undef BASE_INTERFACE
#endif
#ifndef INTERFACE_ATEST_ITESTANOTHEREX_IID
#define INTERFACE_ATEST_ITESTANOTHEREX_IID "/atest/iTestAnotherEx"
#endif
#if defined(__cplusplus) && !defined(CINTERFACE)
namespace atest {
#define INTERFACE iTestAnotherEx
#define BASE_INTERFACE ::atest::iTestBase
#ifndef INTERFACE_ATEST_ITESTANOTHEREX
#define INTERFACE_ATEST_ITESTANOTHEREX ::atest::iTestAnotherEx
#endif
#else /* C-like declaration */
#define INTERFACE atest_iTestAnotherEx
#define BASE_INTERFACE atest_iTestBase
#ifndef INTERFACE_ATEST_ITESTANOTHEREX
#define INTERFACE_ATEST_ITESTANOTHEREX atest_iTestAnotherEx
#endif
#endif
CLI_DECLARE_INTERFACE_(INTERFACE, BASE_INTERFACE)
{
/* interface ::cli::iUnknown methods */
CLIMETHOD(queryInterface) (THIS_ const CHAR* interfaceId /* [in] char* interfaceId */
, VOID** ifPtr /* [out] void* ifPtr */
) PURE;
CLIMETHOD_(ULONG, addRef) (THIS) PURE;
CLIMETHOD_(ULONG, release) (THIS) PURE;
/* interface ::atest::iTestBase methods */
CLIMETHOD(strBaseGet) (THIS_ CLISTR* _strBase
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
) PURE;
CLIMETHOD(strBaseSet) (THIS_ const CLISTR* _strBase
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
) PURE;
CLIMETHOD(strBaseSize1) (THIS_ SIZE_T* _size /* [out] size_t _size */) PURE;
CLIMETHOD(strBaseSize2) (THIS_ SIZE_T* _size /* [out] size_t _size */
, SIZE_T idx1 /* [in] size_t idx1 */
) PURE;
CLIMETHOD(structSimpleGet) (THIS_ STRUCT_ATEST_ASTRUCT* _structSimple /* [out] ::atest::AStruct _structSimple */) PURE;
CLIMETHOD(structSimpleSet) (THIS_ const STRUCT_ATEST_ASTRUCT* _structSimple /* [in,ref] ::atest::AStruct _structSimple */) PURE;
CLIMETHOD(structV1Get) (THIS_ STRUCT_ATEST_ASTRUCT* _structV1 /* [out] ::atest::AStruct _structV1 */
, SIZE_T idx1 /* [in] size_t idx1 */
) PURE;
CLIMETHOD(structV1Set) (THIS_ const STRUCT_ATEST_ASTRUCT* _structV1 /* [in,ref] ::atest::AStruct _structV1 */
, SIZE_T idx1 /* [in] size_t idx1 */
) PURE;
CLIMETHOD(structV1Size) (THIS_ SIZE_T* _size /* [out] size_t _size */) PURE;
CLIMETHOD(structV2Get) (THIS_ UNION_ATEST_AUNION* _structV2 /* [out] ::atest::AUnion _structV2 */
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
) PURE;
CLIMETHOD(structV2Set) (THIS_ const UNION_ATEST_AUNION* _structV2 /* [in,ref] ::atest::AUnion _structV2 */
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
) PURE;
CLIMETHOD(structV2Size1) (THIS_ SIZE_T* _size /* [out] size_t _size */) PURE;
CLIMETHOD(structV2Size2) (THIS_ SIZE_T* _size /* [out] size_t _size */
, SIZE_T idx1 /* [in] size_t idx1 */
) PURE;
/* interface ::atest::iTestAnotherEx methods */
CLIMETHOD(doSomething) (THIS_ SIZE_T some /* [in] size_t some */) PURE;
CLIMETHOD(strExGet) (THIS_ CLISTR* _strEx
, SIZE_T idx1 /* [in] size_t idx1 */
) PURE;
CLIMETHOD(strExSet) (THIS_ const CLISTR* _strEx
, SIZE_T idx1 /* [in] size_t idx1 */
) PURE;
CLIMETHOD(strExSize) (THIS_ SIZE_T* _size /* [out] size_t _size */) PURE;
};
#if defined(__cplusplus) && !defined(CINTERFACE)
}; // namespace atest
namespace cli{
template<> struct CIidOfImpl< ::atest::iTestAnotherEx >
{
static char const * getName() { return INTERFACE_ATEST_ITESTANOTHEREX_IID; }
};
template<> struct CIidOfImpl< ::atest::iTestAnotherEx* >
{
static char const * getName() { return CIidOfImpl< ::atest::iTestAnotherEx > :: getName(); }
};
}; // namespace cli
namespace atest {
// interface ::atest::iTestAnotherEx wrapper
// generated from F:\work\cli2\trunk\out\Win32\cidl\conf\templates\wrapper_template.cpp template file
template <
typename smartPtrType
/*
=
::cli::CCliPtr< INTERFACE_ATEST_ITESTANOTHEREX >
*/
>
class CiTestAnotherExWrapper
{
public:
typedef CiTestAnotherExWrapper< smartPtrType > wrapper_type;
typedef typename smartPtrType::interface_type interface_type;
typedef typename smartPtrType::interface_pointer_type interface_pointer_type;
typedef typename smartPtrType::pointer_type pointer_type;
protected:
// pointer to interface variable name
// allways must be pif - autogeneration depends on this name
smartPtrType pif;
public:
CiTestAnotherExWrapper() :
pif(0) {}
CiTestAnotherExWrapper( iTestAnotherEx *_pi, bool noAddRef=false) :
pif(_pi, noAddRef)
{ }
operator bool() const { return bool(pif); }
bool operator!() const { return pif.operator!(); }
interface_pointer_type* getPP() { return pif.getPP(); }
interface_pointer_type getIfPtr()
{
interface_pointer_type* ptrPtr = pif.getPP();
if (!ptrPtr) return 0;
return *ptrPtr;
}
void release()
{
pif.release();
}
CiTestAnotherExWrapper( const CHAR *componentId, INTERFACE_CLI_IUNKNOWN *pOuter=0) :
pif(0)
{
RCODE res = pif.createObject( componentId, pOuter );
if (RC_FAIL(res))
throw ::std::runtime_error("Failed to create requiested component");
}
CiTestAnotherExWrapper( const ::std::string &componentId, INTERFACE_CLI_IUNKNOWN *pOuter=0) :
pif(0)
{
if (componentId.empty())
throw ::std::runtime_error("Empty component name taken");
RCODE res = pif.createObject( componentId.c_str(), pOuter );
if (RC_FAIL(res))
throw ::std::runtime_error("Failed to create requiested component");
}
CiTestAnotherExWrapper( INTERFACE_CLI_IUNKNOWN *pUnk) :
pif(0)
{
::cli::CFoolishPtr<INTERFACE_CLI_IUNKNOWN> tmpPtr(pUnk);
RCODE res = tmpPtr.queryInterface(pif);
if (RC_FAIL(res))
throw ::std::runtime_error("Requested interface not supported by object");
}
CiTestAnotherExWrapper(const CiTestAnotherExWrapper &i) :
pif(i.pif) { }
~CiTestAnotherExWrapper() { }
CiTestAnotherExWrapper& operator=(const CiTestAnotherExWrapper &i)
{
if (&i!=this) pif = i.pif;
return *this;
}
template <typename T>
RCODE queryInterface( T **t)
{
return pif.queryInterface(t);
}
template <typename T>
RCODE queryInterface( T &t)
{
t.release();
return pif.queryInterface(t.getPP());
}
RCODE create(CHAR const * componentId, INTERFACE_CLI_IUNKNOWN *pOuter=0)
{
return pif.createObject(componentId, pOuter);
}
// Automaticaly generated methods code goes here
#if !defined(CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS)
::std::wstring get_strBase( SIZE_T idx1
, SIZE_T idx2
)
{
::std::wstring tmpVal;
RCODE res = strBaseGet( tmpVal, idx1, idx2);
CLI_CHECK_GET_PROPERTY_RESULT(res);
return tmpVal;
}
void set_strBase( SIZE_T idx1
, SIZE_T idx2
, const ::std::wstring &_strBase
)
{ // MS style - indeces are before value, need reorder
RCODE res = strBaseSet( _strBase, idx1, idx2 );
CLI_CHECK_SET_PROPERTY_RESULT(res);
}
SIZE_T size1_strBase( )
{
SIZE_T size;
RCODE res = strBaseSize1( &size );
CLI_CHECK_PROPERTY_SIZE_RESULT(res);
return size;
}
SIZE_T size2_strBase( SIZE_T idx1 )
{
SIZE_T size;
RCODE res = strBaseSize2( &size, idx1 );
CLI_CHECK_PROPERTY_SIZE_RESULT(res);
return size;
}
#if !defined(CLI_WRAPPER_NO_PROPERTIES)
/* GCC note: invalid access to non-static data member of NULL object warning must be ignored. This is known GCC "offsetof problem"
By default, special version of code used for GCC, use DISABLE_GCC_OFFSETOF_WARNING_WORKAROUND to switch off workaround and see this warning */
CLI_DECLARE_PROPERTY_RW_IDX2(wrapper_type, ::std::wstring, strBase, SIZE_T, SIZE_T );
#endif /* CLI_WRAPPER_NO_PROPERTIES */
#endif /* CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS */
RCODE strBaseGet( ::std::wstring &_strBase
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
)
{
CCliStr tmp__strBase; CCliStr_init( tmp__strBase );
RCODE res = pif->strBaseGet(&tmp__strBase, idx1, idx2);
if (RCOK(res))
{
CCliStr_copyFromIfModified( _strBase, tmp__strBase);
}
return res;
}
RCODE strBaseSet( const ::std::wstring &_strBase
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
)
{
CCliStr tmp__strBase; CCliStr_lightCopyTo( tmp__strBase, _strBase);
return pif->strBaseSet(&tmp__strBase, idx1, idx2);
}
RCODE strBaseSize1( SIZE_T* _size /* [out] size_t _size */)
{
return pif->strBaseSize1(_size);
}
RCODE strBaseSize2( SIZE_T* _size /* [out] size_t _size */
, SIZE_T idx1 /* [in] size_t idx1 */
)
{
return pif->strBaseSize2(_size, idx1);
}
#if !defined(CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS)
STRUCT_ATEST_ASTRUCT get_structSimple( )
{
STRUCT_ATEST_ASTRUCT tmpVal;
RCODE res = structSimpleGet( tmpVal);
CLI_CHECK_GET_PROPERTY_RESULT(res);
return tmpVal;
}
void set_structSimple( const STRUCT_ATEST_ASTRUCT &_structSimple
)
{
RCODE res = structSimpleSet( _structSimple );
CLI_CHECK_SET_PROPERTY_RESULT(res);
}
#if !defined(CLI_WRAPPER_NO_PROPERTIES)
/* GCC note: invalid access to non-static data member of NULL object warning must be ignored. This is known GCC "offsetof problem"
By default, special version of code used for GCC, use DISABLE_GCC_OFFSETOF_WARNING_WORKAROUND to switch off workaround and see this warning */
CLI_DECLARE_PROPERTY_RW(wrapper_type, STRUCT_ATEST_ASTRUCT, structSimple );
#endif /* CLI_WRAPPER_NO_PROPERTIES */
#endif /* CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS */
RCODE structSimpleGet( STRUCT_ATEST_ASTRUCT &_structSimple /* [out] ::atest::AStruct _structSimple (struct passed by ref in wrapper) */)
{
return pif->structSimpleGet(&_structSimple);
}
RCODE structSimpleSet( const STRUCT_ATEST_ASTRUCT &_structSimple /* [in,ref] ::atest::AStruct _structSimple (struct passed by ref in wrapper) */)
{
return pif->structSimpleSet(&_structSimple);
}
#if !defined(CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS)
STRUCT_ATEST_ASTRUCT get_structV1( SIZE_T idx1 )
{
STRUCT_ATEST_ASTRUCT tmpVal;
RCODE res = structV1Get( tmpVal, idx1);
CLI_CHECK_GET_PROPERTY_RESULT(res);
return tmpVal;
}
void set_structV1( SIZE_T idx1 , const STRUCT_ATEST_ASTRUCT &_structV1
)
{ // MS style - index goes before value, need reorder
RCODE res = structV1Set( _structV1, idx1 );
CLI_CHECK_SET_PROPERTY_RESULT(res);
}
SIZE_T size_structV1( )
{
SIZE_T size;
RCODE res = structV1Size( &size );
CLI_CHECK_PROPERTY_SIZE_RESULT(res);
return size;
}
#if !defined(CLI_WRAPPER_NO_PROPERTIES)
/* GCC note: invalid access to non-static data member of NULL object warning must be ignored. This is known GCC "offsetof problem"
By default, special version of code used for GCC, use DISABLE_GCC_OFFSETOF_WARNING_WORKAROUND to switch off workaround and see this warning */
CLI_DECLARE_PROPERTY_RW_IDX1(wrapper_type, STRUCT_ATEST_ASTRUCT, structV1, SIZE_T );
#endif /* CLI_WRAPPER_NO_PROPERTIES */
#endif /* CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS */
RCODE structV1Get( STRUCT_ATEST_ASTRUCT &_structV1 /* [out] ::atest::AStruct _structV1 (struct passed by ref in wrapper) */
, SIZE_T idx1 /* [in] size_t idx1 */
)
{
return pif->structV1Get(&_structV1, idx1);
}
RCODE structV1Set( const STRUCT_ATEST_ASTRUCT &_structV1 /* [in,ref] ::atest::AStruct _structV1 (struct passed by ref in wrapper) */
, SIZE_T idx1 /* [in] size_t idx1 */
)
{
return pif->structV1Set(&_structV1, idx1);
}
RCODE structV1Size( SIZE_T* _size /* [out] size_t _size */)
{
return pif->structV1Size(_size);
}
#if !defined(CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS)
UNION_ATEST_AUNION get_structV2( SIZE_T idx1
, SIZE_T idx2
)
{
UNION_ATEST_AUNION tmpVal;
RCODE res = structV2Get( &tmpVal, idx1, idx2);
CLI_CHECK_GET_PROPERTY_RESULT(res);
return tmpVal;
}
void set_structV2( SIZE_T idx1
, SIZE_T idx2
, UNION_ATEST_AUNION _structV2
)
{ // MS style - indeces are before value, need reorder
RCODE res = structV2Set( _structV2, idx1, idx2 );
CLI_CHECK_SET_PROPERTY_RESULT(res);
}
SIZE_T size1_structV2( )
{
SIZE_T size;
RCODE res = structV2Size1( &size );
CLI_CHECK_PROPERTY_SIZE_RESULT(res);
return size;
}
SIZE_T size2_structV2( SIZE_T idx1 )
{
SIZE_T size;
RCODE res = structV2Size2( &size, idx1 );
CLI_CHECK_PROPERTY_SIZE_RESULT(res);
return size;
}
#if !defined(CLI_WRAPPER_NO_PROPERTIES)
/* GCC note: invalid access to non-static data member of NULL object warning must be ignored. This is known GCC "offsetof problem"
By default, special version of code used for GCC, use DISABLE_GCC_OFFSETOF_WARNING_WORKAROUND to switch off workaround and see this warning */
CLI_DECLARE_PROPERTY_RW_IDX2(wrapper_type, UNION_ATEST_AUNION, structV2, SIZE_T, SIZE_T );
#endif /* CLI_WRAPPER_NO_PROPERTIES */
#endif /* CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS */
RCODE structV2Get( UNION_ATEST_AUNION &_structV2 /* [out] ::atest::AUnion _structV2 (struct passed by ref in wrapper) */
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
)
{
return pif->structV2Get(_structV2, idx1, idx2);
}
RCODE structV2Set( const UNION_ATEST_AUNION &_structV2 /* [in,ref] ::atest::AUnion _structV2 (struct passed by ref in wrapper) */
, SIZE_T idx1 /* [in] size_t idx1 */
, SIZE_T idx2 /* [in] size_t idx2 */
)
{
return pif->structV2Set(_structV2, idx1, idx2);
}
RCODE structV2Size1( SIZE_T* _size /* [out] size_t _size */)
{
return pif->structV2Size1(_size);
}
RCODE structV2Size2( SIZE_T* _size /* [out] size_t _size */
, SIZE_T idx1 /* [in] size_t idx1 */
)
{
return pif->structV2Size2(_size, idx1);
}
RCODE doSomething( SIZE_T some /* [in] size_t some */)
{
return pif->doSomething(some);
}
#if !defined(CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS)
::std::wstring get_strEx( SIZE_T idx1 )
{
::std::wstring tmpVal;
RCODE res = strExGet( tmpVal, idx1);
CLI_CHECK_GET_PROPERTY_RESULT(res);
return tmpVal;
}
void set_strEx( SIZE_T idx1 , const ::std::wstring &_strEx
)
{ // MS style - index goes before value, need reorder
RCODE res = strExSet( _strEx, idx1 );
CLI_CHECK_SET_PROPERTY_RESULT(res);
}
SIZE_T size_strEx( )
{
SIZE_T size;
RCODE res = strExSize( &size );
CLI_CHECK_PROPERTY_SIZE_RESULT(res);
return size;
}
#if !defined(CLI_WRAPPER_NO_PROPERTIES)
/* GCC note: invalid access to non-static data member of NULL object warning must be ignored. This is known GCC "offsetof problem"
By default, special version of code used for GCC, use DISABLE_GCC_OFFSETOF_WARNING_WORKAROUND to switch off workaround and see this warning */
CLI_DECLARE_PROPERTY_RW_IDX1(wrapper_type, ::std::wstring, strEx, SIZE_T );
#endif /* CLI_WRAPPER_NO_PROPERTIES */
#endif /* CLI_WRAPPER_NO_SAFE_PROPERTY_METHODS */
RCODE strExGet( ::std::wstring &_strEx
, SIZE_T idx1 /* [in] size_t idx1 */
)
{
CCliStr tmp__strEx; CCliStr_init( tmp__strEx );
RCODE res = pif->strExGet(&tmp__strEx, idx1);
if (RCOK(res))
{
CCliStr_copyFromIfModified( _strEx, tmp__strEx);
}
return res;
}
RCODE strExSet( const ::std::wstring &_strEx
, SIZE_T idx1 /* [in] size_t idx1 */
)
{
CCliStr tmp__strEx; CCliStr_lightCopyTo( tmp__strEx, _strEx);
return pif->strExSet(&tmp__strEx, idx1);
}
RCODE strExSize( SIZE_T* _size /* [out] size_t _size */)
{
return pif->strExSize(_size);
}
}; // class CiTestAnotherExWrapper
typedef CiTestAnotherExWrapper< ::cli::CCliPtr< INTERFACE_ATEST_ITESTANOTHEREX > > CiTestAnotherEx;
typedef CiTestAnotherExWrapper< ::cli::CFoolishPtr< INTERFACE_ATEST_ITESTANOTHEREX > > CiTestAnotherEx_nrc; /* No ref counting for interface used */
}; // namespace atest
#endif
#endif /* CLI_ATEST_H */