Beispiel #1
0
DDS_StdString
be_enum::swap_call(const DDS_StdString & arg)
{
   DDS_StdString ret = "(" + NoColons(ScopedName()) + ")" + m_swapCall + "(*" + arg + ")";

   return ret;
}
Beispiel #2
0
void
be_sequence::InitializeTypeMap(be_Type* t)
{
   idlType = t;

   DDS_StdString outName;

   if (t)
   {
      t->TypeName(t->Scope(t->LocalName()));
      t->InTypeName("const " + t->TypeName() + "&");
      t->InOutTypeName(t->TypeName() + "&");

      t->OutTypeName(t->TypeName() + DDSOutExtension);
      t->ReturnTypeName(t->TypeName() + "*");

      t->DMFAdtMemberTypeName(t->TypeName() + "*");
      t->StructMemberTypeName(t->TypeName());
      t->UnionMemberTypeName(t->TypeName());
      t->SequenceMemberTypeName(t->TypeName());


      t->VarSignature(VT_InParam, t->TypeName(), VT_Const, VT_Var, VT_Reference);
      t->VarSignature(VT_InOutParam, t->TypeName(), VT_NonConst, VT_Var, VT_Reference);
      t->VarSignature(VT_OutParam, t->OutTypeName(), VT_NonConst, VT_Var, VT_NonReference);
      t->VarSignature(VT_Return, t->TypeName(), VT_NonConst, VT_Pointer, VT_NonReference);

      be_sequence * t_sequence = 0;

      if ((t_sequence = (be_sequence*)t->narrow((long) & be_sequence::type_id)))
      {
         t_sequence->OsOpSignature((DDS_StdString)"DDS::Codec::OutStream& operator<<(DDS::Codec::OutStream& os, const "
                                   + t->Scope(t->LocalName()) + "& s)");
         t_sequence->IsOpSignature((DDS_StdString)"DDS::Codec::InStream& operator>>(DDS::Codec::InStream& is, "
                                   + t->Scope(t->LocalName()) + "& s)");
      }

      if (BE_Globals::nesting_bug == pbtrue)
      {
         const char * streamopName = t->StreamOpTypeName();

         t->StreamOpTypeName(t->Scope(t->LocalName()));
         ColonToBar((char *)streamopName);
      }

      DDS_StdString scopedname = NoColons(t->EnclosingScope() + "_" + t->LocalName());
      t->TypeCodeTypeName(BE_Globals::TCPrefix + t->LocalName());
      t->TypeCodeBaseName(BE_Globals::TCBasePrefix + scopedname);
      t->TypeCodeRepName(BE_Globals::TCRepPrefix + scopedname);
      t->MetaTypeTypeName(BE_Globals::MTPrefix + scopedname);
   }
   else
   {
      assert (0);
   }
}
Beispiel #3
0
be_typedef::be_typedef (AST_Type *bt, UTL_ScopedName *n, const UTL_Pragmas &p)
:
   AST_Decl (AST_Decl::NT_typedef, n, p),
   AST_Typedef (bt, n, p),
   m_generateBase (FALSE),
   m_generated (FALSE),
   m_baseBeType (0)
{
   AST_Type* astType = base_type();
   be_array* ba;
   be_sequence* bs;

   localName = local_name()->get_string();
   enclosingScope = be_Type::EnclosingScopeString(this);
   m_baseBeType = get_base_be_type();

   //
   // make sure the base type has a name (if anonymous)
   //

   bs = (be_sequence*)astType->narrow((long) & be_sequence::type_id);
   if (bs)
   {
      m_generateBase = bs->SetName(enclosingScope, localName);
   }
   else if ((ba = (be_array*)astType->narrow((long) & be_array::type_id)))
   {
      m_generateBase = ba->SetName(enclosingScope, localName);
   }

   //
   // now initialize the base's type and typemap
   //
   m_baseBeType->Initialize();

   m_baseBeType->HasTypeDef (pbtrue);

   InitializeTypeMap (this);

   m_typecode = m_baseBeType->m_typecode;
   m_typecode->id = get_decl_pragmas().get_repositoryID()->get_string();
   m_typecode->name_of_type = localName;

   DDS_StdString scopedname = NoColons(enclosingScope + "_" + localName);

   TypeCodeTypeName(BE_Globals::TCPrefix + localName);

   MetaTypeTypeName(BE_Globals::MTPrefix + scopedname);

   TypeCodeRepName(BE_Globals::TCRepPrefix + scopedname);

   TypeCodeBaseName(BE_Globals::TCBasePrefix + scopedname);
}
Beispiel #4
0
void
be_sequence::init_type(const DDS_StdString& scope,
                       const DDS_StdString& name)
{
   enclosingScope = scope;
   localName = name;

   m_tc_ctor_val = NoColons((DDS_StdString) Scope(localName) + "_ctor");
   m_tc_dtor_val = NoColons((DDS_StdString) Scope(localName) + "_dtor");
   if (local() != I_TRUE)
   {
      m_tc_put_val = NoColons((DDS_StdString) Scope(localName) + "_put");
      m_tc_get_val = NoColons((DDS_StdString) Scope(localName) + "_get");
   }
   else
   {
      m_tc_put_val = (DDS_StdString)"0";
      m_tc_get_val = (DDS_StdString)"0";
   }
   m_tc_assign_val = NoColons((DDS_StdString)
                              Scope(localName) + "_copy");

   InitializeTypeMap(this);
}
Beispiel #5
0
DDS_StdString be_operation::ScopedBaseRequestCall ()
{
  UTL_ScopeActiveIterator *
    i = new UTL_ScopeActiveIterator (this, IK_decls);
  ostringstream
    os;
  pbbool
    first = pbtrue;
  DDS_StdString
    ret;
  AST_Decl *
    d;

  DDS_StdString
    ifaceBasename_nocolons = NoColons (iface->ScopedName ());

  if (ifaceBasename_nocolons.length ())
    {
      os << ifaceBasename_nocolons << "::" << LocalName ();
    }
  else
    {
      os << LocalName ();
    }

  // GENERATE PARAMETER LIST
  os << "(";

  for (; !(i->is_done ()); i->next ())
    {
      be_argument *
        arg;

      d = i->item ();

      arg = (be_argument *) d->narrow ((long) &be_argument::type_id);
      if (arg)
        {
          if (!first)
            {
              os << ", ";
            }
          first = pbfalse;

          os << " " << arg->LocalName ();
        }
    }

  delete
    i;

  // ADD CONTEXT

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

      first = pbfalse;

      os << " " << DDSCtxVar;
    }

  // THIS IS FOR PROPERTIES
  if (!first)
    os << ", ";

  os << "0";

  first = pbfalse;

  os << ")" << ends;

  ret = os.str().c_str();
  return ret;
}