#include <SMESH_Gen_i.hxx>
Public Member Functions | |
| StudyContext () | |
| ~StudyContext () | |
| int | addObject (string theIOR) |
| int | findId (string theIOR) |
| string | getIORbyId (const int theId) |
| string | getIORbyOldId (const int theOldId) |
| void | mapOldToNew (const int oldId, const int newId) |
| int | getOldId (const int newId) |
Private Member Functions | |
| int | getNextId () |
Private Attributes | |
| map< int, string > | mapIdToIOR |
| map< int, int > | mapIdToId |
Definition at line 60 of file SMESH_Gen_i.hxx.
| StudyContext.StudyContext | ( | ) |
Definition at line 64 of file SMESH_Gen_i.hxx.
{}
| StudyContext.~StudyContext | ( | ) |
Definition at line 66 of file SMESH_Gen_i.hxx.
{
mapIdToIOR.clear();
mapIdToId.clear();
}
| int StudyContext.addObject | ( | string | theIOR | ) |
Definition at line 72 of file SMESH_Gen_i.hxx.
Referenced by SMESH_Gen_i.RegisterObject().
{
int nextId = getNextId();
mapIdToIOR[ nextId ] = theIOR;
return nextId;
}
| int StudyContext.findId | ( | string | theIOR | ) |
Definition at line 79 of file SMESH_Gen_i.hxx.
Referenced by SMESH_Gen_i.GetObjectId(), SMESH_Gen_i.IORToLocalPersistentID(), SMESH_Gen_i.Load(), and SMESH_Gen_i.Save().
{
map<int, string>::iterator imap;
for ( imap = mapIdToIOR.begin(); imap != mapIdToIOR.end(); ++imap ) {
if ( imap->second == theIOR )
return imap->first;
}
return 0;
}
| string StudyContext.getIORbyId | ( | const int | theId | ) |
Definition at line 89 of file SMESH_Gen_i.hxx.
{
if ( mapIdToIOR.find( theId ) != mapIdToIOR.end() )
return mapIdToIOR[ theId ];
return string( "" );
}
| string StudyContext.getIORbyOldId | ( | const int | theOldId | ) |
Definition at line 96 of file SMESH_Gen_i.hxx.
Referenced by SMESH_Gen_i.Load(), and SMESH_Gen_i.LocalPersistentIDToIOR().
{
if ( mapIdToId.find( theOldId ) != mapIdToId.end() )
return getIORbyId( mapIdToId[ theOldId ] );
return string( "" );
}
| int StudyContext.getNextId | ( | ) | [private] |
Definition at line 118 of file SMESH_Gen_i.hxx.
{
int id = 1;
while( mapIdToIOR.find( id ) != mapIdToIOR.end() )
id++;
return id;
}
Definition at line 107 of file SMESH_Gen_i.hxx.
Referenced by SMESH_Gen_i.Load().
Definition at line 103 of file SMESH_Gen_i.hxx.
Referenced by SMESH_Gen_i.Load().
{
mapIdToId[ oldId ] = newId;
}
map<int, int> StudyContext.mapIdToId [private] |
Definition at line 127 of file SMESH_Gen_i.hxx.
map<int, string> StudyContext.mapIdToIOR [private] |
Definition at line 126 of file SMESH_Gen_i.hxx.