#include <StructDef.h>
Inheritance diagram for Omniifr::StructDef_impl:


Public Member Functions | |
| StructMemberSeq * | members () |
| void | members (const StructMemberSeq &v) |
| DefinitionKind | def_kind () |
| TypeCode_ptr | type () |
| StructDef_impl () | |
| virtual | ~StructDef_impl () |
| void | uncheckedDestroy () |
| Destroys this object, without first checking for dependencies. | |
| bool | canContain (DefinitionKind kind) |
| Returns TRUE if this Container_impl can contain type 'kind'. | |
| void | reincarnate (const PersistNode &node) |
| Re-create the repository from information saved in the log file. | |
| void | output (ostream &os) |
| Save this object's state to a stream. | |
Private Attributes | |
| Dependency3< StructMemberSeq > | _members |
|
|
Definition at line 48 of file StructDef.h. References _members. 00048 :_members(this){}
|
|
|
Definition at line 49 of file StructDef.h. 00049 {}
|
|
|
Returns TRUE if this Container_impl can contain type 'kind'. Legal relationships are defined in CORBA spec. section 10.4.4 "Structure and Navigation of the Interface Repository". Implements Omniifr::Container_impl. Definition at line 77 of file StructDef.cc. 00078 {
00079 switch(kind)
00080 {
00081 case dk_Struct:
00082 case dk_Union:
00083 case dk_Enum:
00084 return true;
00085 default:
00086 return false;
00087 }
00088 }
|
|
|
Implements Omniifr::IRObject_impl. Definition at line 41 of file StructDef.h. 00041 {return dk_Struct;}
|
|
|
Definition at line 35 of file StructDef.cc. References _members, Omniifr::Dependency3< T_xxxDescriptionSeq >::assign(), Omniifr::IRObject_impl::checkReadonly(), DB, and IFELSE_OMNIORB4. 00036 {
00037 checkReadonly();
00038 // Spec: "When setting the members attribute, the type member of the
00039 // StructMember structure should be set to TC_void."
00040 // I interpret this as meaning that the type member is set by the setter
00041 // method (here). The word 'should' implies a recommendation rather than an
00042 // imperative - I choose to not throw an exception if type is set, only to
00043 // ignore its value.
00044 StructMemberSeq temp(v); // take a copy (v is const).
00045 for(ULong i=0; i<temp.length(); i++)
00046 {
00047 if(CORBA::is_nil(temp[i].type_def))
00048 throw CORBA::BAD_PARAM(
00049 IFELSE_OMNIORB4(omni::BAD_PARAM_InvalidObjectRef,43),
00050 CORBA::COMPLETED_NO
00051 );
00052 try {
00053 temp[i].type=temp[i].type_def->type();
00054 }
00055 catch(...) {
00056 DB(15,"Caught exception at "<<__FILE__<<":"<<__LINE__)
00057 throw; // If an exception occurs, just propagate it as-is.
00058 }
00059 }
00060
00061 _members.assign(temp);
00062 }
|
|
|
Definition at line 30 of file StructDef.cc. References _members, and Omniifr::Dependency3< T_xxxDescriptionSeq >::copy(). 00031 {
00032 return _members.copy();
00033 }
|
|
|
Save this object's state to a stream.
Implements Omniifr::IRObject_impl. Definition at line 98 of file StructDef.cc. References _members, Omniifr::Dependency3< T_xxxDescriptionSeq >::in(), Omniifr::Container_impl::outputContents(), and Omniifr::Contained_impl::outputSelf(). 00099 {
00100 outputSelf(os,"StructDef");
00101 cdrMemoryStream memstr(CORBA::ULong(0),CORBA::Boolean(1)/*clearMemory*/);
00102 _members.in()>>=memstr;
00103 PersistNode::outputCdrMemoryStream(os,memstr,"\n state=");
00104 os<<" ;;\n";
00105 outputContents(os);
00106 }
|
|
|
Re-create the repository from information saved in the log file.
Reimplemented from Omniifr::IRObject_impl. Definition at line 90 of file StructDef.cc. References _members, and Omniifr::Dependency3< T_xxxDescriptionSeq >::uncheckedAssign(). 00091 {
00092 cdrMemoryStream memstr =node.attrCdrStream("state");
00093 StructMemberSeq m;
00094 m<<=memstr;
00095 _members.uncheckedAssign(m); // Skip the checks performed by members(m)
00096 }
|
|
|
Implements Omniifr::IDLType_impl. Definition at line 64 of file StructDef.cc. References _members, and Omniifr::Dependency3< T_xxxDescriptionSeq >::in(). 00065 {
00066 return Repository_impl::inst()._orb
00067 ->create_struct_tc(_id.in(),_name.in(),_members.in());
00068 }
|
|
|
Destroys this object, without first checking for dependencies.
Implements Omniifr::Container_impl. Definition at line 70 of file StructDef.cc. References _members, and Omniifr::Dependency3< T_xxxDescriptionSeq >::clear(). 00071 {
00072 _members.clear();
00073 Contained_impl::uncheckedDestroy();
00074 Container_impl::uncheckedDestroy();
00075 }
|
|
|
Definition at line 46 of file StructDef.h. Referenced by members(), output(), reincarnate(), StructDef_impl(), type(), and uncheckedDestroy(). |
1.4.1