Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

AttributeDef.cc

Go to the documentation of this file.
00001 //                            Package   : omniIFR
00002 //  AttributeDef.cc           Created   : 2004/02/22
00003 //                            Author    : Alex Tingle
00004 //
00005 //    Copyright (C) 2004 Alex Tingle.
00006 //
00007 //    This file is part of the omniIFR application.
00008 //
00009 //    omniIFR is free software; you can redistribute it and/or
00010 //    modify it under the terms of the GNU Lesser General Public
00011 //    License as published by the Free Software Foundation; either
00012 //    version 2.1 of the License, or (at your option) any later version.
00013 //
00014 //    omniIFR is distributed in the hope that it will be useful,
00015 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 //    Lesser General Public License for more details.
00018 //
00019 //    You should have received a copy of the GNU Lesser General Public
00020 //    License along with this library; if not, write to the Free Software
00021 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //
00023 #include "AttributeDef.h"
00024 
00025 #include "idltype.h"
00026 #include "PersistNode.h"
00027 #include "string_to.h"
00028 
00029 namespace Omniifr {
00030 
00031 TypeCode_ptr AttributeDef_impl::type()
00032 {
00033   return _type_def.in()->type();
00034 }
00035 
00036 IDLType_ptr AttributeDef_impl::type_def()
00037 {
00038   return IDLType::_duplicate(_type_def.in());
00039 }
00040 
00041 void AttributeDef_impl::type_def(IDLType_ptr v)
00042 {
00043   checkReadonly();
00044   _type_def.assign(IDLType::_duplicate(v));
00045 }
00046 
00047 
00048 CORBA::Contained::Description* AttributeDef_impl::describe()
00049 {
00050   AttributeDescription_var attributedesc =new AttributeDescription();
00051   attributedesc->name       =name();
00052   attributedesc->id         =id();
00053   attributedesc->version    =version();
00054   attributedesc->type       =type();
00055   attributedesc->mode       =mode();
00056   attributedesc->defined_in =definedInId();
00057 
00058   CORBA::Contained::Description_var description =
00059     new CORBA::Contained::Description();
00060   description->kind  =   def_kind();
00061   description->value <<= attributedesc._retn();
00062 
00063   return description._retn();
00064 }
00065 
00066 void AttributeDef_impl::uncheckedDestroy()
00067 {
00068   _type_def.clear();
00069   Contained_impl::uncheckedDestroy();
00070 }
00071 
00072 void AttributeDef_impl::reincarnate(const PersistNode& node)
00073 {
00074   _mode=(AttributeMode)node.attrLong("mode");
00075   _type_def.assign(
00076     string_to_<CORBA::IDLType>(node.attrString("type_def").c_str())
00077   );
00078 }
00079 
00080 void AttributeDef_impl::output(ostream &os)
00081 {
00082   outputSelf(os,"AttributeDef");
00083   os<<"\n mode="<<_mode;
00084   PersistNode::outputIOR(os,_type_def.in(),"\n type_def=");
00085   os<<" ;;\n";
00086 }
00087 
00088 } // end namespace Omniifr

Generated on Fri Mar 4 13:03:22 2005 for OmniIFR by  doxygen 1.4.1