本文整理汇总了C++中idl_fileCur函数的典型用法代码示例。如果您正苦于以下问题:C++ idl_fileCur函数的具体用法?C++ idl_fileCur怎么用?C++ idl_fileCur使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了idl_fileCur函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: idl_moduleClose
static void
idl_moduleClose(
void *userData)
{
idlpp_indent_level--;
idl_printIndent(idlpp_indent_level);
idl_fileOutPrintf(idl_fileCur(), "}\n");
idl_fileOutPrintf(idl_fileCur(), "\n");
}
开发者ID:diorahman,项目名称:opensplice,代码行数:9,代码来源:idl_genCxxTypedClassDefs.c
示例2: idl_moduleOpen
static idl_action
idl_moduleOpen (
idl_scope scope,
const char *name,
void *userData)
{
/* Test whether the module contains a component within the pragma keylist.
* If it does not, then the module should not be generated since it will
* contain no items (which is itself illegal idl syntax).
*
* Note that we are comparing against only the keys existing within this idl
* file (idl_idlScopeKeyList). We do not use the result of idl_keyDefDefGet()
* since this is a list of keys resulting from the preprocessed idl (which
* will include keys from other idl files that this may include).
*/
if (os_iterLength (idl_idlScopeKeyList) == 0) {
return idl_abort;
} else {
c_long li = 0;
c_bool scopesMatch = FALSE;
idl_scope moduleScope;
idl_scopeElement newElement;
/* the idl_scope parameter to this function does not yet include the scoping
* for this module itself, so create a duplicate and add this scoping to it,
* before testing whether this module contains one of the keys in this file.
*/
moduleScope = idl_scopeDup(scope);
newElement = idl_scopeElementNew (name, idl_tModule);
idl_scopePush (moduleScope, newElement);
/* Loop through the list of keys applying to this idl file and test whether
* this particular module contains one of these keys. If it does, generate
* code for the module in the Dcps.idl file.
*/
while (li < os_iterLength (idl_idlScopeKeyList)) {
idl_scope keyscope = os_iterObject (idl_idlScopeKeyList, li);
scopesMatch = idl_scopeSub (moduleScope, keyscope);
if (scopesMatch) {
break;
}
li++;
}
if (scopesMatch == FALSE) {
return idl_abort;
}
}
idl_printIndent(idlpp_indent_level);
idl_fileOutPrintf(idl_fileCur(), "module %s {\n", idl_cxxId(name));
idl_fileOutPrintf(idl_fileCur(), "\n");
idlpp_indent_level++;
return idl_explore;
}
开发者ID:diorahman,项目名称:opensplice,代码行数:56,代码来源:idl_genCxxIdl.c
示例3: idl_moduleOpen
static idl_action
idl_moduleOpen (
idl_scope scope,
const char *name,
void *userData)
{
c_ulong streamsIndex, streamsCount;
idl_action result;
OS_UNUSED_ARG(userData);
OS_UNUSED_ARG(userData);
/* Test whether the module contains a component within the pragma streams.
* If it does not, then the module should not be generated since it will
* contain no items (which is itself illegal idl syntax).
*
* Note that we are comparing against only the streams existing within this idl
* file (idl_idlScopeStreamsList). We do not use the result of idl_keyDefDefGet()
* since this is a list of streams resulting from the preprocessed idl (which
* will include streams from other idl files that this may include).
*/
result = idl_abort;
streamsCount = os_iterLength(idl_idlScopeStreamsList);
if (streamsCount != 0) {
idl_scope moduleScope;
idl_scopeElement newElement;
/* the idl_scope parameter to this function does not yet include the scoping
* for this module itself, so create a duplicate and add this scoping to it,
* before testing whether this module contains one of the streams in this file.
*/
moduleScope = idl_scopeDup(scope);
newElement = idl_scopeElementNew(name, idl_tModule);
idl_scopePush(moduleScope, newElement);
/* Loop through the list of keys applying to this idl file and test whether
* this particular module contains one of these keys. If it does, generate
* code for the module.
*/
for (streamsIndex = 0; (streamsIndex < streamsCount) && (result == idl_abort); streamsIndex++) {
idl_scope streamsScope = os_iterObject(idl_idlScopeStreamsList, streamsIndex);
if (idl_scopeSub(moduleScope, streamsScope)) {
/* Scopes match */
result = idl_explore;
}
}
}
if (result == idl_explore) {
idl_printIndent(idlpp_indent_level);
idl_fileOutPrintf(idl_fileCur(), "module %s {\n", idl_cxxId(name));
idl_fileOutPrintf(idl_fileCur(), "\n");
idlpp_indent_level++;
}
return result;
}
开发者ID:osrf,项目名称:opensplice,代码行数:56,代码来源:idl_genCxxStreamsIdl.c
示例4: idl_registerBodyHeader
static void
idl_registerBodyHeader (
const char *basename
)
{
idl_fileOutPrintf (idl_fileCur(), "#include <c_metabase.h>\n");
idl_fileOutPrintf (idl_fileCur(), "#include <sd_serializerXMLTypeinfo.h>\n");
idl_fileOutPrintf (idl_fileCur(), "\n");
idl_fileOutPrintf (idl_fileCur(), "#include \"%s_register.h\"\n", basename);
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:10,代码来源:idl_registerType.c
示例5: idl_moduleOpen
static idl_action
idl_moduleOpen(
idl_scope scope,
const char *name,
void *userData)
{
idl_printIndent(idlpp_indent_level);
idl_fileOutPrintf(idl_fileCur(), "namespace %s {\n", idl_cxxId(name));
idl_fileOutPrintf(idl_fileCur(), "\n");
idlpp_indent_level++;
return idl_explore;
}
开发者ID:diorahman,项目名称:opensplice,代码行数:12,代码来源:idl_genCxxTypedClassDefs.c
示例6: switch
/** @brief callback function called on closure of a union in the IDL input file.
*
* Generate code for the following IDL construct:
* @verbatim
union <union-name> switch(<switch-type>) {
case label1.1; .. case label1.n;
<union-case-1>;
case label2.1; .. case label2.n;
... ...
case labeln.1; .. case labeln.n;
<union-case-n>;
default:
<union-case-m>;
=> };
@endverbatim
*
* The union is closed:
* @verbatim
} _u;
};
@endverbatim
* @param name Name of the union
*/
static void
idl_unionClose (
const char *name,
void *userData)
{
indent_level--;
idl_printIndent(indent_level);
idl_fileOutPrintf(idl_fileCur(), "} _u;\n");
indent_level--;
idl_printIndent(indent_level);
idl_fileOutPrintf(idl_fileCur(), "};\n\n");
}
开发者ID:diorahman,项目名称:opensplice,代码行数:35,代码来源:idl_genSpliceType.c
示例7: idl_moduleClose
static void
idl_moduleClose(
void *userData)
{
OS_UNUSED_ARG(userData);
/* this is only executed if idl_moduleOpen returns 'idl_explore' */
OS_UNUSED_ARG(userData);
idlpp_indent_level--;
idl_printIndent(idlpp_indent_level);
idl_fileOutPrintf(idl_fileCur(), "};\n");
idl_fileOutPrintf(idl_fileCur(), "\n");
}
开发者ID:osrf,项目名称:opensplice,代码行数:13,代码来源:idl_genCxxStreamsIdl.c
示例8: idl_moduleOpen
/** @brief callback function called on module definition in the IDL input file.
*
* Generate code for the following IDL construct:
* @verbatim
=> module <module-name> {
<module-contents>
};
@endverbatim
*
* This fuction generates the prototype of the function that
* is responsible for loading the metadata into the database.
* The name of the function is:
* @verbatim
__<scope-basename>_<scope-elements>_<module-name>__load
@endverbatim
* For the Splice types, no further actions are required.
*
* @param scope Current scope (and scope of the module definition)
* @param name Name of the defined module
* @return Next action for this module (idl_explore)
*/
static idl_action
idl_moduleOpen(
idl_scope scope,
const char *name,
void *userData)
{
idl_fileOutPrintf(idl_fileCur(), "extern c_metaObject __%s_%s__load (c_base base);\n",
idl_scopeBasename(scope),
idl_scopeStack(scope, "_", name));
idl_fileOutPrintf(idl_fileCur(), "\n");
/* return idl_explore to indicate that the rest of the module needs to be processed */
return idl_explore;
}
开发者ID:diorahman,项目名称:opensplice,代码行数:35,代码来源:idl_genSpliceType.c
示例9: java_arrayDimensions
/* @brief generate dimension of an array or a sequence
*
* java_arrayDimensions is a local support function to generate
* the dimensions of a java Array representing an IDL sequence or
* array. Since Sequences will always be initialized to 0 elements,
* its dimensions will always be assigned 0. Arrays will be assigned
* their IDL dimensions.
*
* @param typeSeq Specifies the type of the sequence
*/
static void
java_arrayDimensions(
idl_typeSpec typeSpec)
{
while (idl_typeSpecType(typeSpec) == idl_ttypedef) {
typeSpec = idl_typeDefRefered(idl_typeDef(typeSpec));
}
if (idl_typeSpecType(typeSpec) == idl_tarray) {
idl_typeArray typeArray = idl_typeArray(typeSpec);
idl_fileOutPrintf (idl_fileCur(), "[%d]", idl_typeArraySize(typeArray));
java_arrayDimensions(idl_typeArrayType(typeArray));
} else if (idl_typeSpecType(typeSpec) == idl_tseq) {
idl_fileOutPrintf(idl_fileCur(), "[0]");
java_arrayDimensions(idl_typeSeqType(idl_typeSeq(typeSpec)));
}
}
开发者ID:S73417H,项目名称:opensplice,代码行数:26,代码来源:idl_genSajType.c
示例10: idl_structureOpen
static idl_action
idl_structureOpen(
idl_scope scope,
const char *name,
idl_typeStruct structSpec,
void *userData)
{
c_char spaces[20];
idl_tmplExp te;
CxxTypeUserData *cxxUserData = (CxxTypeUserData *)userData;
/* QAC EXPECT 3416; No side effects here */
if (idl_keyResolve(idl_keyDefDefGet(), scope, name) != NULL) {
/* keylist defined for this struct */
te = idl_tmplExpNew(idlpp_macroSet);
idl_macroSetAdd(idlpp_macroSet,
idl_macroNew("namescope", idl_cxxId(idl_scopeElementName(idl_scopeCur(scope)))));
idl_macroSetAdd(idlpp_macroSet,
idl_macroNew("cnamescope", idl_scopeStack(scope, "_", "")));
idl_macroSetAdd(idlpp_macroSet, idl_macroNew("typename", idl_cxxId(name)));
snprintf(spaces, sizeof(spaces), "%d", idlpp_indent_level*4);
idl_macroSetAdd(idlpp_macroSet, idl_macroNew("spaces", spaces));
idlpp_inStream = idl_streamInNew(idlpp_template, idlpp_macroAttrib);
idl_tmplExpProcessTmpl(te, idlpp_inStream, idl_fileCur());
idl_streamInFree(idlpp_inStream);
idl_tmplExpFree(te);
/* Store data-type in iterator for future generation of type descriptor. */
idl_metaCxxAddType(scope, name, idl_typeSpec(structSpec), &cxxUserData->idlpp_metaList);
}
return idl_abort;
}
开发者ID:osrf,项目名称:opensplice,代码行数:32,代码来源:idl_genCxxTypedClassDefs.c
示例11: idl_unionOpen
static idl_action
idl_unionOpen (
idl_scope scope,
const char *name,
idl_typeUnion unionSpec,
void *userData)
{
c_char spaces[20];
idl_tmplExp te;
/* QAC EXPECT 3416; No unexpected side effects here */
if (idl_keyResolve(idl_keyDefDefGet(), scope, name) != NULL) {
/* keylist defined for this union */
idl_sequenceObjManagDef(scope, name, idl_typeSpec(unionSpec));
te = idl_tmplExpNew(idlpp_macroSet);
idl_macroSetAdd(idlpp_macroSet, idl_macroNew("type_name", idl_scopeStack(scope, "_", name)));
snprintf(spaces, (size_t)sizeof(spaces), "%d", idlpp_indent_level*4);
idl_macroSetAdd(idlpp_macroSet, idl_macroNew ("spaces", spaces));
idlpp_inStream = idl_streamInNew(idlpp_template, idlpp_macroAttrib);
idl_tmplExpProcessTmpl(te, idlpp_inStream, idl_fileCur());
idl_streamInFree(idlpp_inStream);
idl_tmplExpFree(te);
}
return idl_abort;
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:25,代码来源:idl_genSacTypedClassImpl.c
示例12: idl_fileClose
/* @brief callback function called on closing the IDL input file.
*
* Generate standard file footer consisting of:
* - mutiple inclusion prevention closure
*/
static void
idl_fileClose(
void *userData)
{
/* Generate closure of multiple inclusion prevention code */
idl_fileOutPrintf(idl_fileCur(), "#endif\n");
}
开发者ID:diorahman,项目名称:opensplice,代码行数:12,代码来源:idl_genSpliceType.c
示例13: idl_typedefOpenClose
static void
idl_typedefOpenClose(
idl_scope scope,
const char *name,
idl_typeDef defSpec,
void *userData)
{
c_char spaces[20];
idl_tmplExp te;
/* QAC EXPECT 3416; No unexpected side effects here */
if ((idl_typeSpecType(idl_typeDefRefered(defSpec)) == idl_tstruct ||
idl_typeSpecType(idl_typeDefRefered(defSpec)) == idl_tunion) &&
idl_keyResolve(idl_keyDefDefGet(), scope, name) != NULL) {
/* keylist defined for this typedef of struct or union */
te = idl_tmplExpNew(idlpp_macroSet);
idl_macroSetAdd(idlpp_macroSet, idl_macroNew("type_name", idl_scopeStack(scope, "_", name)));
snprintf(spaces, (size_t)sizeof(spaces), "%d", idlpp_indent_level*4);
idl_macroSetAdd(idlpp_macroSet, idl_macroNew("spaces", spaces));
idlpp_inStream = idl_streamInNew(idlpp_template, idlpp_macroAttrib);
idl_tmplExpProcessTmpl(te, idlpp_inStream, idl_fileCur());
idl_streamInFree(idlpp_inStream);
idl_tmplExpFree(te);
}
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:25,代码来源:idl_genSacTypedClassDefs.c
示例14: idl_structureOpen
static idl_action
idl_structureOpen(
idl_scope scope,
const char *name,
idl_typeStruct structSpec,
void *userData)
{
c_char spaces[20];
idl_tmplExp te;
/* QAC EXPECT 3416; No side effects here */
if (idl_keyResolve(idl_keyDefDefGet(), scope, name) != NULL) {
/* keylist defined for this struct */
te = idl_tmplExpNew(idlpp_macroSet);
idl_macroSetAdd(idlpp_macroSet,
idl_macroNew("namescope", idl_cxxId(idl_scopeElementName(idl_scopeCur(scope)))));
idl_macroSetAdd(idlpp_macroSet, idl_macroNew("typename", idl_cxxId(name)));
snprintf(spaces, (size_t)sizeof(spaces), "%d", idlpp_indent_level*4);
idl_macroSetAdd(idlpp_macroSet, idl_macroNew("spaces", spaces));
idlpp_inStream = idl_streamInNew(idlpp_template, idlpp_macroAttrib);
idl_tmplExpProcessTmpl(te, idlpp_inStream, idl_fileCur());
idl_streamInFree(idlpp_inStream);
idl_tmplExpFree(te);
}
return idl_abort;
}
开发者ID:diorahman,项目名称:opensplice,代码行数:26,代码来源:idl_genCxxTypedClassDefs.c
示例15: idl_unionOpen
static idl_action
idl_unionOpen(
idl_scope scope,
const char *name,
idl_typeUnion unionSpec,
void *userData)
{
c_char spaces[20];
idl_tmplExp te;
OS_UNUSED_ARG(unionSpec);
OS_UNUSED_ARG(userData);
/* QAC EXPECT 3416; No side effects here */
if (idl_streamsResolve(idl_streamsDefDefGet(), scope, name)) {
/* keylist defined for this union */
te = idl_tmplExpNew(idlpp_macroSet);
idl_macroSetAdd(idlpp_macroSet,
idl_macroNew("namescope", idl_cxxId(idl_scopeElementName(idl_scopeCur(scope)))));
idl_macroSetAdd(idlpp_macroSet, idl_macroNew("typename", idl_cxxId(name)));
idl_macroSetAdd(idlpp_macroSet, idl_macroNew("scopedtypename", idl_scopeStack(scope, "::", name)));
snprintf(spaces, sizeof(spaces), "%d", idlpp_indent_level*4);
idl_macroSetAdd(idlpp_macroSet, idl_macroNew("spaces", spaces));
idlpp_inStream = idl_streamInNew(idlpp_template, idlpp_macroAttrib);
idl_tmplExpProcessTmpl(te, idlpp_inStream, idl_fileCur());
idl_streamInFree(idlpp_inStream);
idl_tmplExpFree(te);
}
return idl_abort;
}
开发者ID:osrf,项目名称:opensplice,代码行数:30,代码来源:idl_genCxxStreamsDefs.c
示例16: idl_typedefOpenClose
static void
idl_typedefOpenClose(
idl_scope scope,
const char *name,
idl_typeDef defSpec,
void *userData)
{
c_char spaces[20];
idl_tmplExp te;
OS_UNUSED_ARG(userData);
if ((idl_typeSpecType(idl_typeDefRefered(defSpec)) == idl_tstruct ||
(idl_typeSpecType(idl_typeDefRefered(defSpec)) == idl_tunion)) &&
(idl_streamsResolve(idl_streamsDefDefGet(), scope, name))) {
/* keylist defined for this typedef of struct or union */
te = idl_tmplExpNew(idlpp_macroSet);
idl_macroSetAdd(idlpp_macroSet,
idl_macroNew("namescope", idl_cxxId(idl_scopeElementName(idl_scopeCur(scope)))));
idl_macroSetAdd(idlpp_macroSet, idl_macroNew("typename", idl_cxxId(name)));
idl_macroSetAdd(idlpp_macroSet, idl_macroNew("scopedtypename", idl_scopeStack(scope, "::", name)));
snprintf(spaces, sizeof(spaces), "%d", idlpp_indent_level*4);
idl_macroSetAdd(idlpp_macroSet, idl_macroNew("spaces", spaces));
idlpp_inStream = idl_streamInNew(idlpp_template, idlpp_macroAttrib);
idl_tmplExpProcessTmpl(te, idlpp_inStream, idl_fileCur());
idl_streamInFree(idlpp_inStream);
idl_tmplExpFree(te);
}
}
开发者ID:osrf,项目名称:opensplice,代码行数:29,代码来源:idl_genCxxStreamsDefs.c
示例17: idl_fileClose
static void
idl_fileClose(
void *userData)
{
OS_UNUSED_ARG(userData);
idl_fileOutPrintf(idl_fileCur(), "#endif\n");
}
开发者ID:osrf,项目名称:opensplice,代码行数:8,代码来源:idl_genCxxStreamsDefs.c
示例18: idl_structureOpen
/** @brief callback function called on structure definition in the IDL input file.
*
* Generate code for the following IDL construct:
* @verbatim
=> struct <structure-name> {
<structure-member-1>;
... ...
<structure-member-n>;
};
@endverbatim
*
* @param scope Current scope (and scope of the structure definition)
* @param name Name of the structure
* @param structSpec Specification of the struct holding the amount of members
*/
static idl_action
idl_structureOpen(
idl_scope scope,
const char *name,
idl_typeStruct structSpec,
void *userData)
{
/* Open file for used scope, if needed create the directories */
idl_openJavaPackage(scope, idl_javaId(name));
if (idl_fileCur() == NULL) {
return idl_abort;
}
/* setup iterator to hold field names and correcsponding type names */
map = idl_mapNew(NULL, 1, 1);
/* Write package name */
#if 0
idl_fileOutPrintf (idl_fileCur(), "/*\n");
idl_fileOutPrintf (idl_fileCur(), " * Generated by OpenSpliceDDS "OSPL_VERSION_STR"\n");
idl_fileOutPrintf (idl_fileCur(), " */\n\n");
#endif
if (idl_scopeStackSize(scope) > 0) {
idl_fileOutPrintf(idl_fileCur(), "package %s;\n", idl_scopeStackJava (scope, ".", NULL));
idl_fileOutPrintf(idl_fileCur(), "\n");
}
/* public final class <struct-name> { */
idl_fileOutPrintf(idl_fileCur(), "public final class %s {\n\n", idl_javaId(name));
/* return idl_explore to indicate that the rest of the structure needs to be processed */
return idl_explore;
}
开发者ID:S73417H,项目名称:opensplice,代码行数:44,代码来源:idl_genSajType.c
示例19: idl_fileOpen
/* @brief callback function called on opening the IDL input file.
*
* Generate standard file header consisting of:
* - mutiple inclusion prevention
* - inclusion of Splice type definition files
* - inclusion of application specific include files related to other IDL files
*
* @param scope Current scope (not used)
* @param name Name of the IDL input file
*/
static idl_action
idl_fileOpen(
idl_scope scope,
const char *name,
void *userData)
{
struct idl_genSACPPData *arg = (struct idl_genSACPPData *)userData;
/* First initialize userData */
arg->indent_level = 0;
/* Generate inclusion of type definition file */
idl_fileOutPrintf(idl_fileCur(), "#include \"%s.h\"\n", name);
idl_fileOutPrintf(idl_fileCur(), "\n");
/* return idl_explore to indicate that the rest of the file needs to be processed */
return idl_explore;
}
开发者ID:S73417H,项目名称:opensplice,代码行数:28,代码来源:idl_genSACPPTypeImpl.c
示例20: idl_arraySliceDimensions
/* @brief generate dimension of an array slice
*
* arraySliceDimensions is a local support function to generate
* the array dimensions of an array slice
*
* @param typeArray Specifies the type of the array
*/
static void
idl_arraySliceDimensions(
idl_typeArray typeArray)
{
idl_fileOutPrintf(idl_fileCur(), "[%d]", idl_typeArraySize(typeArray));
if (idl_typeSpecType(idl_typeArrayType(typeArray)) == idl_tarray &&
idl_typeSpecType(idl_typeArrayType(idl_typeArray(idl_typeArrayType(typeArray)))) == idl_tarray) {
idl_arraySliceDimensions(idl_typeArray(idl_typeArrayType(typeArray)));
}
}
开发者ID:S73417H,项目名称:opensplice,代码行数:17,代码来源:idl_genSajType.c
注:本文中的idl_fileCur函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论