Page principale   Liste des namespaces   Hiérarchie des classes   Liste par ordre alphabétique   Liste des composants   Liste des fichiers   Membres des namespaces   Composants   Déclarations  

Référence de la classe ExManagerId

#include <ExManagerId.h>

Graphe d'héritage de la classe ExManagerId

ExManager

Membres publics

void Reset (void)
void Init (void)
void List (void)
ExNihilo::ExId RecordObject (ExCObject &object)
ExNihilo::ExId RecordObject (ExCObject *object)
ExNihilo::ExId GetObjectId (std::string Name, std::string Type)
std::string GetObjectName (ExNihilo::ExId id)
std::string GetObjectType (ExNihilo::ExId id)
ExCAction InputAction (ExCAction Action)

Membres publics statiques

ExManagerId * CreateSingleton (void)

Membres privés

std::string GetAviableName (std::string Name, std::string Type, int occu)
 ExManagerId (void)
 ~ExManagerId (void)

Attributs Privés

int m_ExIdCounter
std::map< ExNihilo::ExId,
ExNihilo::ExObjectInfo, std::less<
ExNihilo::ExId > > * 
m_MapObjectInfo
std::map< ExNihilo::ExId,
ExNihilo::ExObjectInfo, std::less<
ExNihilo::ExId > >::iterator 
m_ItMapObjectInfo

Attributs Privés Statiques

bool m_flag = false
ExManagerId * m_instance = NULL

Documentation des contructeurs et destructeurs

ExManagerId void    [private]
 

Définition à la ligne 43 du fichier ExManagerId.cpp.

Références ExManagerId(), Guard, et m_ExIdCounter.

Référencé par ExManagerId(), et ~ExManagerId().

00044 {
00045 Guard(ExManagerId::ExManagerId())
00046         m_ExIdCounter=0;
00047 UnGuard
00048 }

~ExManagerId void    [private]
 

Définition à la ligne 50 du fichier ExManagerId.cpp.

Références ExManagerId(), et Guard.

00051 {
00052 Guard(ExManagerId::~ExManagerId())
00053 UnGuard
00054 }


Documentation des méthodes

ExManagerId * CreateSingleton void    [static]
 

Définition à la ligne 29 du fichier ExManagerId.cpp.

Références CreateSingleton(), Guard, m_flag, et m_instance.

Référencé par CreateSingleton(), et main().

00029                                              {
00030 Guard(ExManagerId* ExManagerId::CreateSingleton(void))
00031         if(!m_flag)
00032         {
00033                 m_flag = true; // We are creating the error log now, so set flag to true
00034                 m_instance = new ExManagerId; // Create the error log
00035         }else
00036         {
00037                 std::cout<<"Error singleton already created"<<std::endl;
00038         }
00039         return m_instance; 
00040 UnGuard
00041 }

std::string GetAviableName std::string    Name,
std::string    Type,
int    occu
[private]
 

Définition à la ligne 75 du fichier ExManagerId.cpp.

Références GetAviableName(), GetObjectId(), et Guard.

Référencé par GetAviableName(), et RecordObject().

00076 {
00077 Guard(std::string ExManagerId::GetAviableName(std::string Name,std::string Type,int occu))
00078         if(GetObjectId(Name,Type)==-1)//new name
00079         {
00080                 return Name;
00081         }
00082         
00083         //here code to change name
00084         if(occu>0)
00085         {
00086                 Name.erase(Name.end()-1,Name.end());
00087         }
00088         if(occu>10)
00089         {
00090                 Name.erase(Name.end()-1,Name.end());
00091         }
00092         if(occu>100)
00093         {
00094                 Name.erase(Name.end()-1,Name.end());
00095         }
00096         if(occu>1000)
00097         {
00098                 Name.erase(Name.end()-1,Name.end());
00099         }
00100         if(occu>10000)
00101         {
00102                 Name.erase(Name.end()-1,Name.end());
00103         }
00104         char buffer[255];
00105         memset(buffer,0,255);
00106         sprintf(buffer,"%s%d",Name.data(),occu);
00107 
00108         return GetAviableName(buffer,Type,occu+1);
00109         
00110 UnGuard
00111 }

ExNihilo::ExId GetObjectId std::string    Name,
std::string    Type
 

Définition à la ligne 173 du fichier ExManagerId.cpp.

Références GetObjectId(), Guard, m_ItMapObjectInfo, et m_MapObjectInfo.

Référencé par ExManagerTexture::CheckExist(), GetAviableName(), ExManagerObject::GetIterator(), ExManagerObject::GetObject(), GetObjectId(), ExManagerTexture::GetTextureId(), ExManagerObject::Remove(), ExManagerTexture::SetCurrentObject(), et ExManagerObject::SetCurrentObject().

00174 {
00175 Guard(ExNihilo::ExId    ExManagerId::GetObjectId(std::string Name,std::string Type))
00176         for(m_ItMapObjectInfo=m_MapObjectInfo->begin();m_ItMapObjectInfo!=m_MapObjectInfo->end();m_ItMapObjectInfo++)
00177         {
00178                 if(Name==m_ItMapObjectInfo->second.m_Name)//||Type==m_ItMapObjectInfo->second.m_Type)
00179                         return  m_ItMapObjectInfo->second.m_Id;
00180         }
00181         return -1;
00182 UnGuard
00183 }

std::string GetObjectName ExNihilo::ExId    id
 

Définition à la ligne 185 du fichier ExManagerId.cpp.

Références GetObjectName(), Guard, et m_MapObjectInfo.

Référencé par GetObjectName().

00186 {
00187 Guard(std::string               ExManagerId::GetObjectName(ExNihilo::ExId id))
00188         try
00189         {
00190                 return m_MapObjectInfo->find(id)->second.m_Name;        
00191         }
00192         catch(...)
00193         {
00194                 return "NoName";
00195         }
00196 UnGuard
00197 }

std::string GetObjectType ExNihilo::ExId    id
 

Définition à la ligne 199 du fichier ExManagerId.cpp.

Références GetObjectType(), Guard, et m_MapObjectInfo.

Référencé par GetObjectType().

00200 {
00201 Guard(std::string               ExManagerId::GetObjectType(ExNihilo::ExId id))
00202         try
00203         {
00204                 return m_MapObjectInfo->find(id)->second.m_Type;        
00205         }
00206         catch(...)
00207         {
00208                 return "NoName";
00209         }
00210 UnGuard
00211 }

void Init void    [virtual]
 

Redéfinie à partir de ExManager.

Définition à la ligne 68 du fichier ExManagerId.cpp.

Références Guard, Init(), et m_MapObjectInfo.

Référencé par Init(), InitManager(), et Reset().

00069 {
00070 Guard(ExManagerId::Init(void))
00071         m_MapObjectInfo=new std::map<  ExNihilo::ExId   , ExNihilo::ExObjectInfo , std::less <ExNihilo::ExId  >  >;     
00072 UnGuard
00073 }

ExCAction InputAction ExCAction    Action [virtual]
 

Redéfinie à partir de ExManager.

Définition à la ligne 223 du fichier ExManagerId.cpp.

Références Guard, ID_LIST, InputAction(), List(), ExCAction::m_Action, et ExCAction::m_NextAction.

Référencé par InputAction(), et ExManagerCommand::ProcesExCAction().

00224 {
00225 Guard(ExCAction ExManagerId::InputAction(ExCAction Action))
00226         switch(Action.m_Action)
00227         {
00228         case ID_LIST:
00229                 List();
00230                 break;
00231         }
00232         if(Action.m_NextAction){return *Action.m_NextAction;}
00233         else{return NOTHING;}
00234 UnGuard
00235 }

void List void   
 

Définition à la ligne 213 du fichier ExManagerId.cpp.

Références ExManager::Consol, Guard, List(), m_ItMapObjectInfo, et m_MapObjectInfo.

Référencé par InputAction(), et List().

00214 {
00215 Guard(void ExManagerId::List(void))
00216         for(m_ItMapObjectInfo=m_MapObjectInfo->begin();m_ItMapObjectInfo!=m_MapObjectInfo->end();m_ItMapObjectInfo++)
00217         {
00218                 *Consol<<"Id :"<<m_ItMapObjectInfo->second.m_Id<<"  For name:"<<m_ItMapObjectInfo->second.m_Name<<" Type:"<<m_ItMapObjectInfo->second.m_Type<<std::endl;
00219         }       
00220 UnGuard
00221 }

ExNihilo::ExId RecordObject ExCObject   object
 

Définition à la ligne 146 du fichier ExManagerId.cpp.

Références ExManager::Consol, GetAviableName(), ExCObject::GetId(), ExCObject::GetName(), ExCObject::GetType(), Guard, m_ExIdCounter, ExObjectInfo::m_Id, m_MapObjectInfo, ExObjectInfo::m_Name, ExObjectInfo::m_Type, RecordObject(), ExCObject::SetId(), ExCObject::SetName(), et ExCObject::SetType().

00147 {
00148 Guard(ExNihilo::ExId ExManagerId::RecordObject(ExCObject *object))
00149         object->SetId(m_ExIdCounter);m_ExIdCounter++;
00150         std::string name(object->GetType());
00151         if(name.find(" *")<name.length())
00152         {
00153                 name.erase(name.find(" *"),name.length()-name.find(" *"));
00154         }
00155         object->SetName(GetAviableName(object->GetName(),object->GetType(),0));
00156         object->SetType(name);
00157 
00158         ExNihilo::ExObjectInfo Info;
00159         Info.m_Id       = object->GetId();
00160         Info.m_Name     = object->GetName();
00161         Info.m_Type = object->GetType();
00162         
00163         std::pair<ExNihilo::ExId,ExNihilo::ExObjectInfo>  obj;
00164         obj.first=object->GetId();
00165         obj.second=Info;
00166         m_MapObjectInfo->insert(obj);
00167 
00168         *Consol<<"New Id :"<<Info.m_Id<<"  For name:"<<Info.m_Name<<" Type:"<<Info.m_Type<<std::endl;
00169         return Info.m_Id;
00170 UnGuard
00171 }

ExNihilo::ExId RecordObject ExCObject   object
 

Définition à la ligne 113 du fichier ExManagerId.cpp.

Références ExManager::Consol, GetAviableName(), ExCObject::GetId(), ExCObject::GetName(), ExCObject::GetType(), Guard, m_ExIdCounter, ExObjectInfo::m_Id, m_MapObjectInfo, ExObjectInfo::m_Name, ExObjectInfo::m_Type, RecordObject(), ExCObject::SetId(), ExCObject::SetName(), et ExCObject::SetType().

Référencé par ExManagerObject::Add(), ExManagerEntite::Add(), ExManagerEntite::NewObject(), et RecordObject().

00114 {
00115 Guard(ExNihilo::ExId ExManagerId::RecordObject(ExCObject &object))
00116         try
00117         {       
00118                 object.SetId(m_ExIdCounter);m_ExIdCounter++;
00119                 std::string name(object.GetType());
00120                 if(name.find(" *")<name.length())
00121                 {
00122                         name.erase(name.find(" *"),name.length()-name.find(" *"));
00123                 }
00124                 object.SetName(GetAviableName(object.GetName(),object.GetType(),0));
00125                 object.SetType(name);
00126 
00127                 ExNihilo::ExObjectInfo Info;
00128                 Info.m_Id       = object.GetId();
00129                 Info.m_Name     = object.GetName();
00130                 Info.m_Type = object.GetType();
00131                 
00132                 std::pair<ExNihilo::ExId,ExNihilo::ExObjectInfo>  obj;
00133                 obj.first=object.GetId();
00134                 obj.second=Info;
00135                 m_MapObjectInfo->insert(obj);
00136 
00137                 *Consol<<"New Id :"<<Info.m_Id<<"  For name:"<<Info.m_Name<<" Type:"<<Info.m_Type<<std::endl;
00138                 return Info.m_Id;
00139         }catch(...)
00140         {
00141                 throw ExCExpRecordObject();
00142         }
00143 UnGuard
00144 }

void Reset void    [virtual]
 

Redéfinie à partir de ExManager.

Définition à la ligne 58 du fichier ExManagerId.cpp.

Références Guard, Init(), m_ExIdCounter, m_MapObjectInfo, et Reset().

Référencé par ExManagerCommand::ProcesExCAction(), et Reset().

00059 {
00060 Guard(ExManagerId::Reset(void))
00061         m_MapObjectInfo->clear();
00062         delete m_MapObjectInfo;
00063         m_ExIdCounter=0;
00064         Init();
00065 UnGuard
00066 }


Documentation des données imbriquées

int m_ExIdCounter [private]
 

Définition à la ligne 68 du fichier ExManagerId.h.

Référencé par ExManagerId(), RecordObject(), et Reset().

bool m_flag = false [static, private]
 

Définition à la ligne 26 du fichier ExManagerId.cpp.

Référencé par CreateSingleton().

ExManagerId * m_instance = NULL [static, private]
 

Définition à la ligne 27 du fichier ExManagerId.cpp.

Référencé par CreateSingleton().

std::map< ExNihilo::ExId , ExNihilo::ExObjectInfo , std::less <ExNihilo::ExId > >::iterator m_ItMapObjectInfo [private]
 

Définition à la ligne 71 du fichier ExManagerId.h.

Référencé par GetObjectId(), et List().

std::map< ExNihilo::ExId , ExNihilo::ExObjectInfo , std::less <ExNihilo::ExId > >* m_MapObjectInfo [private]
 

Définition à la ligne 70 du fichier ExManagerId.h.

Référencé par GetObjectId(), GetObjectName(), GetObjectType(), Init(), List(), RecordObject(), et Reset().


La documentation associée à cette classe a été générée à partir des fichiers suivants :
Généré le Tue Dec 10 18:18:42 2002 pour ExNihilo par doxygen1.3-rc1