• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ be_ClientHeader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Generate

void be_structure::Generate (be_ClientHeader& source)
{
   if (BE_Globals::ignore_interfaces && IsInterfaceDependant ())
   {
      return;
   }

   if (!Generated())
   {
      be_root::AddAnyOps(*this);
      be_root::AddPutGetOps(*this);
      be_root::AddStreamOps(*this);
      be_root::AddTypedef(*this);
      be_root::AddTypecode(*this);

      ostream & os = source.Stream();
      DDS_StdString scopedName = ScopedName();
      DDS_StdString relativeName;
      be_Tab tab(source);
      TList<be_field *>::iterator mit;
      be_field * field;

      Generated (pbtrue);

      be_root::GenerateDependants(source, SequenceMemberTypeName(),
                                  EnclosingScope());

      g_cppScopeStack.Push(m_cppType);

      // struct definition

      os << nl;
      os << tab << (BE_Globals::isocpp_new_types ? "class " : "struct ") << DLLMACRO << LocalName ()
                <<  (BE_Globals::isocpp_new_types ? " OSPL_DDS_FINAL" : "") << nl;
      os << tab << "{" << nl;
      if (BE_Globals::isocpp_new_types)
        os << tab << "public:" << nl;

      source.Indent();

      // declare nested types

      source.Indent();
      be_CodeGenerator::Generate(source);

      // member accessor functions for isocpp new types
      if (BE_Globals::isocpp_new_types)
      {
        /** @internal
         * @todo OSPL-3369 Repetition; the sort of code people go to hell
         * for (rightfully); is_sequency is already evideantally a stupid name; &c... */
        // Constructors
        if (m_fields.size() > 0)
        {
          os << tab << LocalName() << "() {}" << nl;
          os << tab << "explicit " << LocalName() << "(" << nl;
          for (mit = m_fields.begin(); mit != m_fields.end(); mit++)
          {
            field = *mit;
            bool is_sequency = !(field->get_be_type()->IsPrimitiveType()
                                  || field->get_be_type()->IsEnumeratedType());
            relativeName = BE_Globals::RelativeScope
                (scopedName, field->StructMemberTypeName ());
            TList<be_field *>::iterator final_field = m_fields.end();
            --final_field;
            os << tab << tab << (is_sequency ? "const " : "") << relativeName
                << (is_sequency ? "& " : " ") << field->get_local_name();
            if (mit == final_field)
              os << ")";
            else
              os <<"," << nl;
          }
          os << tab << ":" << nl;
          for (mit = m_fields.begin(); mit != m_fields.end(); mit++)
          {
            field = *mit;
            TList<be_field *>::iterator final_field = m_fields.end();
            --final_field;
            os << tab << tab << tab << field->get_local_name() << "_(" << field->get_local_name() << ")" << (mit == final_field ? " {}" : ",") << nl;
          }
        }
        // C++ 11 move constructor, copy consructor, and assignement ops
        source.Outdent();
        os << "#ifdef OSPL_DDS_CXX11" << nl;
        os << "#  ifdef OSPL_CXX11_NO_FUNCTION_DEFAULTS" << nl;
        source.Indent();
        os << tab << LocalName() << "(const " << LocalName() << "& _other)" << nl;
        if (m_fields.size() > 0)
        {
          os << tab << ":" << nl;
          for (mit = m_fields.begin(); mit != m_fields.end(); mit++)
          {
            field = *mit;
            TList<be_field *>::iterator final_field = m_fields.end();
            --final_field;
            os << tab << tab << tab << field->get_local_name() << "_(_other." << field->get_local_name() << "_)" << (mit == final_field ? "" : ",") << nl;
          }
        }
        os << tab << "{}" << nl;
        os << tab << LocalName() << "(" << LocalName() << "&& _other)" << nl;
//.........这里部分代码省略.........
开发者ID:alex1818,项目名称:opensplice,代码行数:101,代码来源:xbe_structure.cpp


示例17: Generate

void be_structure::Generate (be_ClientHeader& source)
{
   if (BE_Globals::ignore_interfaces && IsInterfaceDependant ())
   {
      return;
   }

   if (!Generated())
   {
      be_root::AddAnyOps(*this);
      be_root::AddPutGetOps(*this);
      be_root::AddStreamOps(*this);
      be_root::AddTypedef(*this);
      be_root::AddTypecode(*this);

      ostream & os = source.Stream();
      DDS_StdString scopedName = ScopedName();
      DDS_StdString relativeName;
      be_Tab tab(source);
      TList<be_field *>::iterator mit;
      be_field * field;

      Generated (pbtrue);

      be_root::GenerateDependants(source, SequenceMemberTypeName(),
                                  EnclosingScope());

      g_cppScopeStack.Push(m_cppType);

      // struct definition

      os << nl;
      os << tab << "struct " << DLLMACRO << LocalName () << nl;
      os << tab << "{" << nl;
      source.Indent ();

      // declare nested types

      be_CodeGenerator::Generate(source);

      // member declarations

      for (mit = m_fields.begin(); mit != m_fields.end(); mit++)
      {
         field = *mit;
         relativeName = BE_Globals::RelativeScope
            (scopedName, field->StructMemberTypeName ());
         os << tab << relativeName << " "
            << field->get_local_name() << ";" << nl;
      }

      source.Outdent();

      source.Stream() << tab << "};" << nl << nl;

      g_cppScopeStack.Pop();

      GenerateAuxTypes (source);

      be_root::GenerateDependants(source, SequenceMemberTypeName(),
                                  EnclosingScope());
   }
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:63,代码来源:xbe_structure.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ bf_read类代码示例发布时间:2022-05-31
下一篇:
C++ bdecode_node类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap