当前位置: 首页>>代码示例>>C++>>正文


C++ be_ClientHeader类代码示例

本文整理汇总了C++中be_ClientHeader的典型用法代码示例。如果您正苦于以下问题:C++ be_ClientHeader类的具体用法?C++ be_ClientHeader怎么用?C++ be_ClientHeader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了be_ClientHeader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: tab

void be_string::GenerateTypedefs
(
   const DDS_StdString & /*scope*/ ,
   const be_typedef& alias,
   be_ClientHeader& source
)
{
   ostream & os = source.Stream();
   be_Tab tab(source);

   if (m_typecode->kind == DDS::tk_string)
   {
      // YO BEN should read "DDS::Char*" from some central place; violates OAOO
      os << tab << "typedef DDS::Char* " << alias.LocalName() << ";" << nl;
      os << tab << "typedef "
      << (const char*)BE_Globals::CorbaScope("String_var") << " "
      << alias.LocalName() << DDSVarExtension << ";" << nl;
      os << tab << "typedef "
      << (const char*)BE_Globals::CorbaScope("String_out") << " "
      << alias.LocalName() << DDSOutExtension << ";" << nl;
   }
   else
   {
      // YO BEN should read "DDS::WChar*" from some central place; violates OAOO
      os << tab << "typedef DDS::WChar* " << alias.LocalName() << ";" << nl;
      os << tab << "typedef "
      << (const char*)BE_Globals::CorbaScope("WString_var") << " "
      << alias.LocalName() << DDSVarExtension << ";" << nl;
      os << tab << "typedef "
      << (const char*)BE_Globals::CorbaScope("WString_out") << " "
      << alias.LocalName() << DDSOutExtension << ";" << nl;
   }
}
开发者ID:diorahman,项目名称:opensplice,代码行数:33,代码来源:xbe_string.cpp

示例2: GenerateAuxTypes

void be_sequence::GenerateAuxTypes (be_ClientHeader & source)
{
   ostream & os = source.Stream();
   be_Tab tab(source);
   DDS_StdString baseName = BaseTypeName ();
   DDS_StdString seqName = localName;
   DDS_StdString varName = localName + "_var";
   DDS_StdString outName = localName + "_out";
   DDS_StdString templateBase = "DDS_DCPSSequence";
   pbbool wideString = pbfalse;

   if (isStringSeq)
   {
      AST_Type* astbt = be_typedef::_astBase (base_type ());
      be_string* sbt = be_string::_narrow (astbt);
      wideString = sbt->IsWide ();
   }

   if (isStringSeq && !IsBounded ())
   {
      templateBase = wideString ? "DDS_DCPSUWStrSeq" : "DDS_DCPSUStrSeq";
   }

   os << tab << "typedef " << templateBase << "_var < " << seqName << "> "
      << varName << ";" << nl;
   os << tab << "typedef " << templateBase << "_out < " << seqName << "> "
      << outName << ";" << nl;
}
开发者ID:cynron,项目名称:opensplice,代码行数:28,代码来源:xbe_sequence.cpp

示例3: GenerateStreamOps

void be_Type::GenerateStreamOps (be_ClientHeader& source)
{
   ostream & os = source.Stream ();
   be_Tab tab (source);

   // insertion

   os << tab << DLLMACRO << "inline void" << nl
   << "IOP::put(DDS::Codec::OutStream& os, const "
   << ScopedName() << "& v" << XBE_Ev::arg (XBE_ENV_ARGN) << ")" << nl;
   os << "{" << nl;
   tab.indent();
   os << tab << "DDS::Codec::Param putArg = ";
   os << "{ " << Scope(TypeCodeTypeName()) << ", ";
   os << "(" << TypeName() << "*)" << "&v, DDS::PARAM_IN ";
   os << "};" << nl;
   os << tab << "os.put (&putArg, 1" << XBE_Ev::arg (XBE_ENV_VARN) << ");" << nl;
   tab.outdent();
   os << "}" << nl << nl;

   //
   // extraction
   //
   os << DLLMACRO << "inline void" << nl
   << "IOP::get(DDS::Codec::InStream& is, "
   << ScopedName() << "& v" << XBE_Ev::arg (XBE_ENV_ARGN) << ")" << nl;
   os << "{" << nl;
   tab.indent();
   os << tab << "DDS::Codec::Param getArg = ";
   os << "{ " << Scope(TypeCodeTypeName()) << ", ";
   os << "&v, DDS::PARAM_OUT };" << nl;
   os << tab << "is.get (&getArg, 1" << XBE_Ev::arg (XBE_ENV_VARN) << ");" << nl;
   tab.outdent();
   os << "}" << nl << nl;
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:35,代码来源:xbe_type.cpp

示例4: GenerateAuxTypes

void be_structure::GenerateAuxTypes (be_ClientHeader& source)
{
   if (BE_Globals::isocpp_new_types)
     return;

   DDS_StdString varName = LocalName () + "_var";
   DDS_StdString outName = LocalName () + "_out";
   ostream & os = source.Stream ();
   be_Tab tab (source);

   if (m_isFixedLength)
   {
      os << tab << "typedef DDS_DCPSStruct_var < "
      << LocalName() << "> " << varName << ";" << nl;
      os << tab << "typedef " << LocalName ()
         << "&" << outName << ";" << nl;
   }
   else
   {
      os << tab << "typedef DDS_DCPSStruct_var < "
      << LocalName() << "> " << varName << ";" << nl;
      os << tab << "typedef DDS_DCPSStruct_out < "
      << LocalName() << "> " << outName << ";" << nl;
   }
}
开发者ID:alex1818,项目名称:opensplice,代码行数:25,代码来源:xbe_structure.cpp

示例5: GenerateConvenienceConstructor

void be_exception::GenerateConvenienceConstructor (be_ClientHeader& source)
{
   ostream & os = source.Stream ();
   const char * argPrefix = "_";
   pbbool first = pbtrue;
   be_Tab tab (source);

   os << tab << LocalName () << " (";

   UTL_Scope * s = (UTL_Scope*)narrow ((long) & UTL_Scope::type_id);
   assert (s);

   // Iterate through decls

   UTL_ScopeActiveIterator *it;

   for
   (
      it = new UTL_ScopeActiveIterator (s, UTL_Scope::IK_decls);
      !it->is_done ();
      it->next ()
   )
   {
      AST_Decl * adecl = it->item();
      assert (adecl);
      be_field * bfield = be_field::_narrow (adecl);
      be_Type * btype;

      if (bfield)
      {
         btype = bfield->get_be_type ();

         if (!first)
         {
            os << ", ";
         }

         first = pbfalse;

         if (btype && btype->IsStringType ())
         {
            // Strings are special case

            os << (char*) BE_Globals::RelativeScope (ScopedName (), bfield->InTypeName ());
         }
         else
         {
            os << (char*) BE_Globals::RelativeScope (ScopedName (), bfield->StructMemberTypeName ());
         }

         os << " " << argPrefix << (char*) bfield->get_local_name ();
      }
   }

   delete it;

   os << ");" << nl;
}
开发者ID:diorahman,项目名称:opensplice,代码行数:58,代码来源:xbe_exception.cpp

示例6: tab

void
be_structure::GenerateDefaultConstructor(be_ClientHeader& source)
{
   ostream & os = source.Stream();
   be_Tab tab(source);

   os << tab << LocalName() << "()" << nl;
   os << tab << "{" << nl << tab << "}" << nl;
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:9,代码来源:xbe_structure.cpp

示例7: tab

void
be_enum::GenerateTypedefs( const DDS_StdString& scope,
                           const be_typedef& alias,
                           be_ClientHeader& source)
{
   ostream & os = source.Stream();
   be_Tab tab(source);

   DDS_StdString relTypeName = BE_Globals::RelativeScope(scope, typeName);

   os << tab << "typedef " << (const char*)relTypeName << " "
   << alias.LocalName() << ";" << nl;
}
开发者ID:osrf,项目名称:opensplice,代码行数:13,代码来源:xbe_enum.cpp

示例8: GeneratePutGetOps

void be_sequence::GeneratePutGetOps (be_ClientHeader& source)
{
   ostream & os = source.Stream ();
   be_Tab tab (source);
   be_predefined_type * prtype = be_predefined_type::_narrow (base_type ());

   //
   // don't generate StreamOps for types that are already in
   // the core
   //

   if ( /* !baseType->IsStringType() && */ // note remove this when replace strseq
      !(prtype &&
        ( (prtype->pt() == AST_PredefinedType::PT_octet) ||
          (prtype->pt() == AST_PredefinedType::PT_char) ||
          (prtype->pt() == AST_PredefinedType::PT_wchar) ||
          (prtype->pt() == AST_PredefinedType::PT_boolean) ) ) )
   {
      os << tab << DLLMACRO << "void " << m_tc_put_val << nl;
      os << tab << "(" << nl;
      tab.indent ();
      os << tab << "DDS::Codec::OutStream & os," << nl;
      os << tab << "const void * arg," << nl;
      os << tab << "DDS::ParameterMode mode" << nl;
      if (XBE_Ev::generate ())
      {
         os << tab << XBE_Ev::arg (XBE_ENV_ARGN, false) << nl;
      }
      tab.outdent ();
      os << tab << ");" << nl << nl;
      os << tab << DLLMACRO << "void " << m_tc_get_val << nl;
      os << tab << "(" << nl;
      tab.indent ();
      os << tab << "DDS::Codec::InStream & is," << nl;
      os << tab << "void * arg," << nl;
      os << tab << "DDS::ParameterMode mode" << nl;
      if (XBE_Ev::generate ())
      {
         os << tab << XBE_Ev::arg (XBE_ENV_ARGN, false) << nl;
      }
      tab.outdent (); //2
      os << tab << ");" << nl << nl;
   }
}
开发者ID:cynron,项目名称:opensplice,代码行数:44,代码来源:xbe_sequence.cpp

示例9: tab

void
be_exception::GenerateMembers(be_ClientHeader& source)
{
   ostream & os = source.Stream();
   pbbool first = pbtrue;
   be_Tab tab(source);

   UTL_Scope * s = (UTL_Scope*)narrow((long) & UTL_Scope::type_id);
   assert(s);

   // ITERATE THROUGH DECLS
   UTL_ScopeActiveIterator *it;

   for ( it = new UTL_ScopeActiveIterator(s, UTL_Scope::IK_decls);
         !it->is_done();
         it->next())
   {
      AST_Decl * adecl = it->item();

      assert(adecl);

      if (first)
      {
         os << nl << tab << "public: " << nl << nl;
         first = pbfalse;
      }

      be_field * bfield = be_field::_narrow(adecl);

      if (bfield)
      {
         os << tab;
         os << BE_Globals::RelativeScope(
            ScopedName(),
            bfield->StructMemberTypeName());
         os << " " << bfield->get_local_name() << ";" << nl;
      }
   }

   delete it;
}
开发者ID:diorahman,项目名称:opensplice,代码行数:41,代码来源:xbe_exception.cpp

示例10: Generate

void be_CppFwdDecl::Generate (be_ClientHeader& source) const
{
   ostream& os = source.Stream();
   be_Tab tab (source);

   if (m_declType == be_CppFwdDecl::INTERFACE)      
   {
      if (!BE_Globals::ignore_interfaces)
      {
         be_interface::GeneratePtrAndRef (source, m_beType->ScopedName(),
                                          m_beType->LocalName());
         be_interface::GenerateVarOutAndMgr (source, m_beType->ScopedName(),
                                             m_beType->LocalName());
         be_interface_fwd::Generated (m_beType->ScopedName());
      }
   }
   else if (!BE_Globals::ignore_interfaces ||
            !m_beType->IsInterfaceDependant ())
   {
      os << tab << keywords[m_declType] << " " << m_beType->LocalName() << ';' << nl;
   }
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:22,代码来源:xbe_cppfwd.cpp

示例11: tab

void
be_sequence::GenerateTypedefs(const DDS_StdString &scope,
                              const be_typedef& alias,
                              be_ClientHeader& source)
{
   ostream & os = source.Stream();
   be_Tab tab(source);
   DDS_StdString relTypeName = BE_Globals::RelativeScope(scope, typeName);

   os << tab << "typedef " << relTypeName << " "
   << alias.LocalName() << ";" << nl;
   os << tab << "typedef " << relTypeName << DDSVarExtension
   << " " << alias.LocalName() << DDSVarExtension << ";" << nl;
   os << tab << "typedef " << relTypeName << DDSOutExtension
   << " " << alias.LocalName() << DDSOutExtension << ";" << nl;

   if (anonymous)
   {
      localName = alias.LocalName ();
      anonymous = pbfalse;
      InitializeTypeMap (this);
   }
}
开发者ID:cynron,项目名称:opensplice,代码行数:23,代码来源:xbe_sequence.cpp

示例12: GeneratePutGetOps

void be_Type::GeneratePutGetOps (be_ClientHeader& source)
{
   ostream & os = source.Stream ();
   be_Tab tab (source);

   // we have to generate even core marshaled ops
   // for use by dependent types, e.g., an
   // array of unions needs the union's ops declared

   // first putval and getval

   os << tab << DLLMACRO << "void " << m_tc_put_val << nl;
   os << tab << "(" << nl;
   tab.indent ();
   os << tab << "DDS::Codec::OutStream & os," << nl;
   os << tab << "const void * arg," << nl;
   os << tab << "DDS::ParameterMode mode" << nl;
   if (XBE_Ev::generate ())
   {
      os << tab << XBE_Ev::arg (XBE_ENV_ARGN, false) << nl;
   }
   tab.outdent ();
   os << tab << ");" << nl << nl;
   os << tab << DLLMACRO << "void " << m_tc_get_val << nl;
   os << tab << "(" << nl;
   tab.indent ();
   os << tab << "DDS::Codec::InStream & is," << nl;
   os << tab << "void * arg," << nl;
   os << tab << "DDS::ParameterMode mode" << nl;
   if (XBE_Ev::generate ())
   {
      os << tab << XBE_Ev::arg (XBE_ENV_ARGN, false) << nl;
   }
   tab.outdent ();
   os << tab << ");" << nl << nl;
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:36,代码来源:xbe_type.cpp

示例13: Generate

void be_exception::Generate (be_ClientHeader & source)
{
   if (!Generated ())
   {
      ostream & os = source.Stream ();
      be_Tab tab (source);
      DDS_StdString lname = LocalName ();

      Generated (pbtrue);

      be_root::AddGlobalDeclarations (this);
      be_root::AddAnyOps (*this);
      be_root::AddStreamOps (*this);
      be_root::AddTypedef (*this);
      be_root::AddTypecode (*this);

      GenerateOpenClassDefinition (source);
      GenerateClassDeclarations (source);
      SetAccess (source, CA_PUBLIC);

      // now define nested types

      be_CodeGenerator::Generate (source);

      // generate _downcast

      os << tab << "static " << lname << "* _downcast ("
         << "DDS::Exception *);" << nl;
      os << tab << "static const " << lname << "* _downcast ("
         << "const DDS::Exception *);" << nl;

      // generate factory and builder

      os << tab << "static DDS::Exception * factory ();" << nl;
      os << tab << "static DDS::ExceptionInitializer m_initializer;" << nl << nl;

      // generate inline default constructor

      os << tab << lname << " () {};" << nl;

      // generate convenience constructor

      if (nmembers())
      {
         GenerateConvenienceConstructor (source);
      }

      // generate copy constructor

      os << tab << lname << " (const " << lname << " &);" << nl;

      // generate assignment operator

      os << tab << lname << "& operator = " << "(const " << lname << " &);" << nl;

      // generate duplicate

      os << tab << "virtual DDS::Exception * _clone () const;" << nl;

      // generate raise

      os << tab << "virtual void _raise (" << XBE_Ev::arg (XBE_ENV_ARG1)
         << ") const;" << nl;

      // generate name

      os << tab << "virtual const char * _name () const { return m_name; };" << nl;

      // generate repository id

      os << tab << "virtual const char * _rep_id () const { return m_id; };" << nl;

      // generate virtual destructor

      os << tab << "virtual ~" << lname << " () {}" << nl;

      GenerateMembers (source);
      SetAccess (source, CA_PRIVATE);

      os << tab << "static const char * m_name;" << nl;
      os << tab << "static const char * m_id;" << nl;

      GenerateCloseClassDefinition (source);

      be_root::GenerateDependants
      (
         source,
         SequenceMemberTypeName (),
         EnclosingScope ()
      );
   }
}
开发者ID:diorahman,项目名称:opensplice,代码行数:92,代码来源:xbe_exception.cpp

示例14: Generate

void be_root::Generate (be_ClientHeader & source)
{
   be_CppFwdDecl::GenerateAllWithinScope (source, be_CppEnclosingScope());

   ostream& os = source.Stream ();
   TList<be_Type *>::iterator bit;
   TList<be_exception *>::iterator git;

   for (bit = fwdDecls.begin(); bit != fwdDecls.end(); bit++)
   {
      (*bit)->GenerateFwdDecls(source);
   }

   os << nl;
   GenerateGlobalTypes (source);
   GenerateGlobalDecls (source);

   g_generatorList.GenerateGlobal (source);

   if (BE_Globals::gen_externalization)
   {
      os << nl;

      for (bit = streamOps.begin(); bit != streamOps.end(); bit++)
      {
         (*bit)->GenerateStreamOps(source);
      }
   }

   os << nl;

   for (git = globalDecls.begin(); git != globalDecls.end(); git++)
   {
      (*git)->GenerateGlobalDecls (source);
   }

   os << nl;

   for (bit = typedefs.begin(); bit != typedefs.end(); bit++)
   {
      (*bit)->GenerateGlobalTypedef (source);
   }

   os << nl;

   if(BE_Globals::isocpp_test_methods)
   {
      //Generate file to stop missing file error
      DDS_StdString BaseFilename;
      BaseFilename = StripExtension(source.Filename());
      BaseFilename += "_testmethod.h";
      be_Source testsource;
      if(!testsource.Open(BaseFilename))
        cerr << "Cannot open: " << BaseFilename << endl;
      testsource.Close();

      //os << nl << "#ifndef " << Ifndefize(BE_Globals::ClientHeaderFilename + "DCPS");
      os << nl << "#ifndef " << Ifndefize(StripExtension(FindFilename(source.Filename())) + "DCPS.h");
      os << nl << "#ifndef " << Ifndefize(StripExtension(FindFilename(source.Filename())) + "_testmethod.h");
      os << nl << "#define " << Ifndefize(StripExtension(FindFilename(source.Filename())) + "_testmethod.h");
      os << nl << "#include \"" << StripExtension(FindFilename(source.Filename())) + "_testmethod.h" << "\"";
      os << nl << "#endif " << nl << "#endif" << nl;

   }

   if (BE_Globals::lite)
   {
       DDS_StdString BaseFilename;
       BaseFilename = StripExtension(source.Filename());

       os << "\n#include \"" << BaseFilename << "-lite.h" << "\"" << nl;
   }

   os << nl << "#endif" << nl;
   source.Close();
}
开发者ID:osrf,项目名称:opensplice,代码行数:76,代码来源:xbe_root.cpp

示例15: GenerateSequence

void be_sequence::GenerateSequence (be_ClientHeader & source)
{
   ostream & os = source.Stream ();
   be_Tab tab (source);
   DDS_StdString elemName;
   pbbool wideString = pbfalse;

   if (isInterfaceSeq || isValueSeq)
   {
      elemName = BE_Globals::RelativeScope(enclosingScope, baseType->ScopedName());
   }
   else
   {
      elemName = BE_Globals::RelativeScope(enclosingScope, baseTypeName);

      if (isStringSeq)
      {
         AST_Type* astbt = be_typedef::_astBase(base_type());
         be_string* sbt = be_string::_narrow(astbt);
         wideString = sbt->IsWide();
      }
   }

   DDS_StdString FileClassname;
   DDS_StdString charFileClassname;
   DDS_StdString boolFileClassname;

   FileClassname = elemName;
   charFileClassname = DDS_StdString("DDSChar");
   boolFileClassname = DDS_StdString("DDSBoolean");

   os << tab << "struct " << localName << "_uniq_ {};" << nl;

   if (IsBounded())
   {
      // Bounded sequence types

      if (baseType->IsFixedLength())
      {
         be_predefined_type * pdt = be_predefined_type::_narrow(base_type());

         os << tab << "typedef DDS_DCPSBFLSeq < " << elemName
            << ", " << FileClassname << ", " << maxSize << "> " << localName << ";" << nl;
      }
      else if (isStringSeq)
      {
         if (wideString)
         {
            os << tab << "typedef DDS_DCPSBWStrSeq < " << maxSize << "> "
            << localName << ";" << nl;
         }
         else
         {
            os << tab << "typedef DDS_DCPSBStrSeq < " << maxSize << "> "
            << localName << ";" << nl;
         }
      }
      else if (isInterfaceSeq)
      {
         os << tab << "typedef DDS_DCPSBObjSeq < " << elemName << ", struct "
            << localName << "_uniq_, " << maxSize << "> " << localName << ";"
            << nl;
      }
      else if (isValueSeq)
      {
         os << tab << "typedef DDS_DCPSBValSeq < " << elemName
         << ", " << maxSize << "> " << localName << ";" << nl;
      }
      else
      {
         os << tab << "typedef DDS_DCPSBVLSeq < " << elemName
         << ", " << maxSize << "> " << localName << ";" << nl;
      }
   }
   else
   {
      // Unbounded sequence types

      if (baseType->IsFixedLength ())
      {
         os << tab << "typedef DDS_DCPSUFLSeq < " << elemName << ", struct "
            << localName << "_uniq_> " << localName << ";" << nl;
      }
      else if (isStringSeq)
      {
         if (wideString)
         {
            os << tab << "typedef DDS_DCPSUWStrSeqT <struct " << localName
               << "_uniq_> " << localName << ";" << nl;
         }
         else
         {
            os << tab << "typedef DDS_DCPSUStrSeqT <struct " << localName 
               << "_uniq_> " << localName << ";" << nl;
         }
      }
      else if (isInterfaceSeq)
      {
         os << tab << "typedef DDS_DCPSUObjSeq < " << elemName << ", struct "
            << localName << "_uniq_> " << localName << ";" << nl;
//.........这里部分代码省略.........
开发者ID:cynron,项目名称:opensplice,代码行数:101,代码来源:xbe_sequence.cpp


注:本文中的be_ClientHeader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。