00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "ArrayDef.h"
00024 #include "Repository.h"
00025 #include "PersistNode.h"
00026 #include "string_to.h"
00027
00028 namespace Omniifr {
00029
00030 TypeCode_ptr ArrayDef_impl::element_type()
00031 {
00032 return _element_type_def.in()->type();
00033 }
00034
00035 CORBA::IDLType_ptr ArrayDef_impl::element_type_def()
00036 {
00037 return _element_type_def.copy();
00038 }
00039
00040 void ArrayDef_impl::element_type_def(CORBA::IDLType_ptr v)
00041 {
00042 checkReadonly();
00043 _element_type_def.assign(CORBA::IDLType::_duplicate(v));
00044 }
00045
00046 TypeCode_ptr ArrayDef_impl::type()
00047 {
00048 TypeCode_var tc =element_type();
00049 return Repository_impl::inst()._orb->create_array_tc(_length,tc.in());
00050 }
00051
00052 ArrayDef_impl::ArrayDef_impl(ULong length):
00053 _length(length),
00054 _element_type_def(this)
00055 {
00056 Repository_impl::inst().addAnonymous(this);
00057 }
00058
00059 void ArrayDef_impl::uncheckedDestroy()
00060 {
00061 Repository_impl::inst().removeAnonymous(this);
00062 _element_type_def.clear();
00063 }
00064
00065 void ArrayDef_impl::reincarnate(const PersistNode& node)
00066 {
00067 _element_type_def.assign(
00068 string_to_<CORBA::IDLType>(node.attrString("element_type_def").c_str())
00069 );
00070 }
00071
00072 void ArrayDef_impl::output(ostream &os)
00073 {
00074 os<<"ArrayDef"<<PersistNode::_separator;
00075 outputOid(os);
00076 os<<"\n length="<<_length;
00077 PersistNode::outputIOR(os,_element_type_def.in(),"\n element_type_def=");
00078 os<<" ;;\n";
00079 }
00080
00081 }