| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

MetaType Class Reference

#include <MetaType.h>

List of all members.


Public Member Functions

 MetaType (IPrinter &, IIntrospectionSvc *)
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
virtual const std::string & name () const
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
virtual bool setName (const std::string &)
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
virtual void setIterator (Lib::IIterator *)
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
virtual Lib::IIterator * iterator ()
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
virtual Lib::Property * getProperties (int &)
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
virtual Lib::Variable value (Lib::Identifier, const std::string &)
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

Private Attributes

std::string fType
IIntrospectionSvc * fIntrospectionSvc
Lib::IIterator * fIterator

Detailed Description

Definition at line 8 of file MetaType.h.


Constructor & Destructor Documentation

MetaType::MetaType ( IPrinter &  ,
IIntrospectionSvc *   
)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

Definition at line 15 of file MetaType.cpp.

00019 :BaseType(aPrinter)
00020 ,fIntrospectionSvc(aIntrospectionSvc)
00021 ,fIterator(0)
00024 {
00025 }


Member Function Documentation

const std::string & MetaType::name (  )  const [virtual]

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

Definition at line 40 of file MetaType.cpp.

00044 {
00045   return fType;
00046 }

bool MetaType::setName ( const std::string &   )  [virtual]

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

Definition at line 27 of file MetaType.cpp.

00032 {
00033   fType = "";
00034   if(!fIntrospectionSvc) return false;
00035   if(!fIntrospectionSvc->existsClass(aName)) return false;
00036   fType = aName;
00037   return true;
00038 }

void MetaType::setIterator ( Lib::IIterator *   )  [virtual]

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

Definition at line 48 of file MetaType.cpp.

00053 {
00054   fIterator = aIterator;
00055 }

Lib::IIterator * MetaType::iterator (  )  [virtual]

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

Definition at line 57 of file MetaType.cpp.

00061 {
00062   return fIterator;
00063 }

Lib::Property * MetaType::getProperties ( int &   )  [virtual]

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

Definition at line 65 of file MetaType.cpp.

00070 {
00071   aNumber = 0;
00072 
00073   //printf("debug : getProps : 000\n");
00074 
00075   MetaClass& metaClass = const_cast<MetaClass&>(fIntrospectionSvc->getClass(fType));
00076   std::vector<MetaField*> fields = metaClass.fields();
00077 
00078   unsigned int number = fields.size();
00079   //printf("debug : getProps : 001 : %d\n",number);
00080 
00081   if(number<=0) return 0;
00082   Lib::Property* list = new Lib::Property[number];
00083   if(!list) return 0;
00084   
00085   for( unsigned int i = 0; i < number; i++ ) {
00086     list[i].set(fields[i]->name(),Lib::Property::DOUBLE);
00087     //printf("debug :  available property \"%s\"\n",fields[i]->name().c_str());
00088   }
00089 
00090   aNumber = number;
00091   return list;
00092 }

Lib::Variable MetaType::value ( Lib::Identifier  ,
const std::string &   
) [virtual]

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

Definition at line 94 of file MetaType.cpp.

00100 {
00101   MetaClass& metaClass = const_cast<MetaClass&>(fIntrospectionSvc->getClass(fType));
00102   std::vector<MetaField*> fields = metaClass.fields();
00103   for( unsigned int i = 0; i < fields.size(); i++ ) {
00104     if(aName==fields[i]->name()) {
00105       double value = 0;
00106       return Lib::Variable(printer(),fields[i]->get(aIdentifier,value));
00107     }
00108   }
00109   return Lib::Variable(printer());
00110 }


Member Data Documentation

std::string MetaType::fType [private]

Definition at line 19 of file MetaType.h.

IIntrospectionSvc* MetaType::fIntrospectionSvc [private]

Definition at line 20 of file MetaType.h.

Lib::IIterator* MetaType::fIterator [private]

Definition at line 21 of file MetaType.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:02:01 2011 for OnXSvc by doxygen 1.4.7