Logo
~Apps~
~Projects~
~Contact~


BTDictionary Class Reference

map in metainfo file More...

#include <BTDictionary.h>

Inheritance diagram for BTDictionary:

Inheritance graph
[legend]
Collaboration diagram for BTDictionary:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BTDictionary (size_t i)
 ~BTDictionary ()
char Type ()
void Show ()
BTObjectFind (const std::string &str)
void AddObject (const std::string &str, BTObject *p)
btmap_tGetMap ()

Private Attributes

btmap_t m_map

Detailed Description

map in metainfo file

Definition at line 34 of file BTDictionary.h.


Constructor & Destructor Documentation

BTDictionary::BTDictionary ( size_t  i  )  [inline]

Definition at line 37 of file BTDictionary.h.

00037 : BTObject(i) {}

BTDictionary::~BTDictionary (  )  [inline]

Definition at line 38 of file BTDictionary.h.

References m_map.

00038                         {
00039                 for (btmap_t::iterator it = m_map.begin(); it != m_map.end(); it++)
00040                 {
00041                         delete (*it).second;
00042                 }
00043         }


Member Function Documentation

char BTDictionary::Type (  )  [inline, virtual]

Implements BTObject.

Definition at line 44 of file BTDictionary.h.

00044 { return 'd'; }

void BTDictionary::Show (  )  [inline, virtual]

Reimplemented from BTObject.

Definition at line 45 of file BTDictionary.h.

References BTObject::GetLength(), BTObject::GetParent(), and m_map.

00045                     {
00046                 bool first = true;
00047                 BTObject *p = GetParent();
00048                 printf("\n");
00049                 printf("Show Dictionary, length %d\n",GetLength());
00050                 while (p)
00051                 {
00052                         printf("  ");
00053                         p = p -> GetParent();
00054                 }
00055                 printf("( ");
00056                 for (btmap_t::iterator it = m_map.begin(); it != m_map.end(); it++)
00057                 {
00058                         if (!first)
00059                                 printf(", ");
00060                         first = false;
00061                         printf("%s: ",(*it).first.c_str());
00062                         (*it).second -> Show();
00063                 }
00064                 printf(")");
00065         }

BTObject* BTDictionary::Find ( const std::string &  str  )  [inline]

Definition at line 66 of file BTDictionary.h.

References m_map.

00066                                              {
00067                 for (btmap_t::iterator it = m_map.begin(); it != m_map.end(); it++)
00068                 {
00069                         if ((*it).first == str)
00070                                 return (*it).second;
00071                 }
00072                 return NULL;
00073         }

void BTDictionary::AddObject ( const std::string &  str,
BTObject p 
) [inline, virtual]

Reimplemented from BTObject.

Definition at line 75 of file BTDictionary.h.

References m_map.

00075                                                          {
00076                 m_map[str] = p;
00077         }

btmap_t& BTDictionary::GetMap (  )  [inline]

Definition at line 78 of file BTDictionary.h.

References m_map.

00078 { return m_map; }


Member Data Documentation

Definition at line 81 of file BTDictionary.h.

Referenced by AddObject(), Find(), GetMap(), Show(), and ~BTDictionary().


The documentation for this class was generated from the following file:
Page, code, and content Copyright (C) 2006 by Anders Hedström
Generated on Mon Aug 29 20:21:47 2005 for C++ Sockets by  doxygen 1.4.4