#include <ConstantDef.h>
Inheritance diagram for Omniifr::ConstantDef_impl:


Public Member Functions | |
| TypeCode_ptr | type () |
| IDLType_ptr | type_def () |
| void | type_def (IDLType_ptr v) |
| CORBA::Any * | value () |
| void | value (const Any &v) |
| DefinitionKind | def_kind () |
| CORBA::Contained::Description * | describe () |
| ConstantDef_impl () | |
| virtual | ~ConstantDef_impl () |
| void | uncheckedDestroy () |
| Destroys this object, without first checking for dependencies. | |
| 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 | |
| Dependency1< IDLType > | _type_def |
| Any | _value |
|
|
Definition at line 52 of file ConstantDef.h. References _type_def, and _value.
|
|
|
Definition at line 53 of file ConstantDef.h. 00053 {}
|
|
|
Implements Omniifr::IRObject_impl. Definition at line 44 of file ConstantDef.h. Referenced by describe(). 00044 {return CORBA::dk_Constant;}
|
|
|
Implements Omniifr::Contained_impl. Definition at line 115 of file ConstantDef.cc. References _value, def_kind(), Omniifr::Contained_impl::definedInId(), Omniifr::Contained_impl::id(), Omniifr::Contained_impl::name(), type(), and Omniifr::Contained_impl::version(). 00116 {
00117 ConstantDescription_var constantdesc =new ConstantDescription();
00118 constantdesc->name =name();
00119 constantdesc->id =id();
00120 constantdesc->version =version();
00121 constantdesc->type =type();
00122 constantdesc->value =_value;
00123 constantdesc->defined_in =definedInId();
00124
00125 CORBA::Contained::Description_var description =
00126 new CORBA::Contained::Description();
00127 description->kind = def_kind();
00128 description->value <<= constantdesc._retn();
00129
00130 return description._retn();
00131 }
|
|
|
Save this object's state to a stream.
Implements Omniifr::IRObject_impl. Definition at line 148 of file ConstantDef.cc. References _type_def, _value, Omniifr::Dependency1< T_IRObject >::in(), and Omniifr::Contained_impl::outputSelf(). 00149 {
00150 outputSelf(os,"ConstantDef");
00151 PersistNode::outputIOR(os,_type_def.in(),"\n type_def=");
00152 cdrMemoryStream memstr(CORBA::ULong(0),CORBA::Boolean(1)/*clearMemory*/);
00153 _value>>=memstr;
00154 PersistNode::outputCdrMemoryStream(os,memstr,"\n value=");
00155 os<<" ;;\n";
00156 }
|
|
|
Re-create the repository from information saved in the log file.
Reimplemented from Omniifr::IRObject_impl. Definition at line 139 of file ConstantDef.cc. References _type_def, _value, and Omniifr::Dependency1< T_IRObject >::assign(). 00140 {
00141 _type_def.assign(
00142 string_to_<IDLType>(node.attrString("type_def").c_str())
00143 );
00144 cdrMemoryStream memstr =node.attrCdrStream("value");
00145 _value<<=memstr;
00146 }
|
|
|
Definition at line 34 of file ConstantDef.cc. References _type_def, and Omniifr::Dependency1< T_IRObject >::in(). Referenced by describe(), and value(). 00035 {
00036 return _type_def.in()->type();
00037 }
|
|
|
Definition at line 44 of file ConstantDef.cc. References _type_def, _value, Omniifr::Dependency1< T_IRObject >::assign(), and Omniifr::IRObject_impl::checkReadonly(). 00045 {
00046 checkReadonly();
00047 TypeCode_var vTc =v->type();
00048 TCKind kind =vTc->kind();
00049 // Strip out aliases. <scoped_name>
00050 while(kind==tk_alias)
00051 {
00052 vTc=vTc->content_type();
00053 kind=vTc->kind();
00054 }
00055
00056 switch(kind)
00057 {
00058 case tk_short: // <integer_type>
00059 case tk_ushort:
00060 case tk_long:
00061 case tk_ulong:
00062 #ifdef HAS_LongLong
00063 case tk_longlong:
00064 case tk_ulonglong:
00065 #endif
00066 case tk_char: // <char_type>
00067 case tk_wchar: // <wide_char_type>
00068 case tk_boolean: // <boolean_type>
00069 case tk_float: // <floating_pt_type>
00070 case tk_double:
00071 #ifdef HAS_LongDouble
00072 case tk_longdouble:
00073 #endif
00074 case tk_string: // <string_type>
00075 case tk_wstring: // <wide_string_type>
00076 case tk_fixed: // <fixed_pt_const_type>
00077 case tk_octet: // <octet_type>
00078 {
00079 TypeCode_var valueTc=_value.type();
00080 _type_def.assign(IDLType::_duplicate(v)); // May throw...
00081 // Erase _value here, unless its TypeCode matches 'v'.
00082 if(!vTc->equivalent(valueTc))
00083 _value=Any();
00084 }
00085 break;
00086
00087 default:
00088 throw CORBA::BAD_PARAM(); // ?? Minor code
00089 }
00090 }
|
|
|
Definition at line 39 of file ConstantDef.cc. References _type_def, and Omniifr::Dependency1< T_IRObject >::in(). 00040 {
00041 return IDLType::_duplicate(_type_def.in());
00042 }
|
|
|
Destroys this object, without first checking for dependencies.
Implements Omniifr::Contained_impl. Definition at line 133 of file ConstantDef.cc. References _type_def, and Omniifr::Dependency1< T_IRObject >::clear(). 00134 {
00135 _type_def.clear();
00136 Contained_impl::uncheckedDestroy(); // superclass
00137 }
|
|
|
Definition at line 97 of file ConstantDef.cc. References _value, Omniifr::IRObject_impl::checkReadonly(), IFELSE_OMNIORB4, and type(). 00098 {
00099 checkReadonly();
00100 CORBA::TypeCode_var thisTc =this->type();
00101 CORBA::TypeCode_var vTc =v.type();
00102 if(thisTc->equivalent(vTc.in()))
00103 {
00104 _value=v;
00105 }
00106 else
00107 {
00108 throw CORBA::BAD_PARAM( // Mico throws NO_PERMISSION here.
00109 IFELSE_OMNIORB4(omni::BAD_PARAM_TargetIsInvalidContainer,4),
00110 CORBA::COMPLETED_NO
00111 );
00112 }
00113 }
|
|
|
Definition at line 92 of file ConstantDef.cc. References _value. 00093 {
00094 return new CORBA::Any(_value);
00095 }
|
|
|
Definition at line 49 of file ConstantDef.h. Referenced by ConstantDef_impl(), output(), reincarnate(), type(), type_def(), and uncheckedDestroy(). |
|
|
Definition at line 50 of file ConstantDef.h. Referenced by ConstantDef_impl(), describe(), output(), reincarnate(), type_def(), and value(). |
1.4.1