CPropertySheetList Class Reference

#include <CPropertySheetList.h>

List of all members.

Public Member Functions

 CPropertySheetList (CXMLElement *inUnprocessedContent)
 ~CPropertySheetList ()
void insertPropertySheet (const string &inID, CXMLElement *inXMLElement)
CXMLElementgetPropertySheet (const string &inID)
CXMLElementnewPropertySheet (const string &inID)

Private Types

typedef map< string,
CXMLElement * > 
CContent

Private Attributes

CContent mContent
CSelfDestroyPointer< CXMLElementmUnprocessedContent


Detailed Description

takes the information contained in the list of properties, which is given in the config.mrml file.

basically, this is a map from string to CXMLElement.

: Wolfgang Müller

Definition at line 41 of file CPropertySheetList.h.


Member Typedef Documentation

typedef map<string,CXMLElement*> CPropertySheetList::CContent [private]

the content of this NO DESTRUCTION RESPONSIBILITY HERE.

Definition at line 45 of file CPropertySheetList.h.


Constructor & Destructor Documentation

CPropertySheetList::CPropertySheetList ( CXMLElement inUnprocessedContent  ) 

We construct *this from a subtree of the document.

Parameters:
inUnprocessedContent is a subtree of the document which will be put in mUnprocessedContent. The children of mUnprocessedContent will then be indexed by CContent.

Definition at line 28 of file CPropertySheetList.cc.

References mrml_const::cui_property_item_id, mContent, and mUnprocessedContent.

00028                                                                        :
00029   mUnprocessedContent(inUnprocessedContent){
00030   //now there comes a small indexing party
00031   //we are looking at the children of the "vi-property-list" ...
00032   for(CXMLElement::lCChildren::iterator i=
00033   mUnprocessedContent->child_list_begin();
00034       i!=mUnprocessedContent->child_list_end();
00035       i++){
00036     //which should all be vi-property-elements so each of them
00037     //SHOULD have an ID. We assert this.
00038     assert((*i)->stringReadAttribute(mrml_const::cui_property_item_id).first);
00039     //the children of each element should be properties
00040     //if not, that's not so cool.
00041     mContent.insert(make_pair((*i)->stringReadAttribute(mrml_const::cui_property_item_id).second,
00042             *((*i)->child_list_begin())));
00043   }
00044 }

CPropertySheetList::~CPropertySheetList (  ) 

presently empty, because the destruction will be done by the structure contained in mUnprocessedContent.

~CPropertySheetList

Definition at line 49 of file CPropertySheetList.cc.

00049                                        {
00050 //   for(CContent::iterator i=mContent.begin();
00051 //       i!=mContent.end();
00052 //       i++){
00053 //     delete i->second;
00054 //   }
00055 }


Member Function Documentation

void CPropertySheetList::insertPropertySheet ( const string &  inID,
CXMLElement inXMLElement 
)

insert an element for this element which is designed by a pointer WE TAKE THE DESTRUCTION RESPONSABILITY

...handing it through to the map

Definition at line 61 of file CPropertySheetList.cc.

References mContent.

00062                                          {
00063   mContent.insert(make_pair(inID,
00064           inXMLElement));
00065   
00066 }

CXMLElement & CPropertySheetList::getPropertySheet ( const string &  inID  ) 

Get a property sheet by its ID

...handing it through to the map

Definition at line 70 of file CPropertySheetList.cc.

References mContent.

00070                                                                    {
00071   CContent::const_iterator lFound=mContent.find(inID);
00072 
00073   if(lFound!=mContent.end()){
00074     return *lFound->second;
00075   }else{
00076     return (*((CXMLElement*)0));
00077   }
00078 }

CXMLElement * CPropertySheetList::newPropertySheet ( const string &  inID  ) 

clone a property sheet by its ID

...handing it through to the map

Definition at line 82 of file CPropertySheetList.cc.

References mContent.

Referenced by CSessionManager::getPropertySheet().

00082                                                                    {
00083   CContent::const_iterator lFound=mContent.find(inID);
00084 
00085   if(lFound!=mContent.end()){
00086     return new CXMLElement(*lFound->second);
00087   }else{
00088     return 0;
00089   }
00090 }


Member Data Documentation

The unprocessed content. mContent will index into that structure we have destruction responsibility

Definition at line 52 of file CPropertySheetList.h.

Referenced by CPropertySheetList().


The documentation for this class was generated from the following files:

Generated on Wed Jan 7 00:31:10 2009 for Gift by  doxygen 1.5.6