Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends

IOMan Class Reference

manages the 'Meta-'data store for the IOObj's. This info is read from the .omf files. More...

Inheritance diagram for IOMan:
NamedObject CallBacker

List of all members.

Classes

class  CustomDirData

Public Member Functions

bool bad () const
bool isReady () const
IOObjget (const MultiID &) const
 Next functions return a new (unmanaged) IOObj.
IOObjgetLocal (const char *objname) const
IOObjgetOfGroup (const char *tgname, bool first=true, bool onlyifsingle=false) const
IOObjgetIfOnlyOne (const char *trgroupname)
IOObjgetByName (const char *objname, const char *partrgname=0, const char *parname=0)
IOObjgetFirst (const IOObjContext &, int *nrpresent=0) const
 if interested in nrpresent pass valid address
IODirdirPtr ()
const IODirdirPtr () const
MultiID key () const
 of current IODir
const char * curDir () const
 OS dir name.
int curLevel () const
const char * rootDir () const
int levelOf (const char *dirnm) const
const char * nameOf (const char *keystr, bool inc_parents=false) const
bool to (const IOLink *)
 NULL -> up-dir.
bool to (const MultiID &)
void back ()
void getEntry (CtxtIOObj &, bool newistmp=false)
 will create a new entry if necessary
bool haveEntries (const MultiID &dirid, const char *trgrpnm=0, const char *trnm=0) const
bool commitChanges (const IOObj &)
bool permRemove (const MultiID &)
const char * surveyName () const
bool setRootDir (const char *)
bool setFileName (MultiID, const char *)
const char * generateFileName (Translator *, const char *)
MultiID newKey () const
void allowSurveyChange ()
void disallowSurveyChange ()
bool canChangeSurvey () const
void applClosing ()

Static Public Member Functions

static const MultiIDaddCustomDataDir (const CustomDirData &)
static bool validSurveySetup (BufferString &errmsg)
static bool newSurvey ()
static bool setSurvey (const char *)
static void enableSurveyChangeTriggers (bool)

Public Attributes

Notifier< IOMannewIODir
Notifier< IOManentryRemoved
Notifier< IOMansurveyToBeChanged
Notifier< IOMansurveyChanged
Notifier< IOManafterSurveyChange
Notifier< IOManapplicationClosing

Private Types

enum  State { Bad, NeedInit, Good }

Private Member Functions

void init ()
 IOMan (const char *rd=0)
 ~IOMan ()
bool setDir (const char *)

Static Private Member Functions

static void setupCustomDataDirs (int)

Private Attributes

State state_
IODirdirptr
int curlvl
MultiID prevkey
FileNameString rootdir
bool canchangesurvey_

Static Private Attributes

static IOMantheinst_

Friends

class IOObj
class IODir
mGlobal IOManIOM ()

Detailed Description

manages the 'Meta-'data store for the IOObj's. This info is read from the .omf files.

There will be one IOMan available through the global function IOM(). Creating more instances is probably not a good idea, but it may work.


Member Enumeration Documentation

enum IOMan::State [private]
Enumerator:
Bad 
NeedInit 
Good 

Constructor & Destructor Documentation

IOMan::IOMan ( const char *  rd = 0  )  [private]
IOMan::~IOMan (  )  [private]

Member Function Documentation

static const MultiID& IOMan::addCustomDataDir ( const CustomDirData  )  [static]

Need to do this only once per OD run At survey change, dir will automatically be added

void IOMan::allowSurveyChange (  )  [inline]
void IOMan::applClosing (  )  [inline]
void IOMan::back (  ) 
bool IOMan::bad (  )  const [inline]
bool IOMan::canChangeSurvey (  )  const [inline]
bool IOMan::commitChanges ( const IOObj  ) 
const char* IOMan::curDir (  )  const

OS dir name.

int IOMan::curLevel (  )  const [inline]
IODir* IOMan::dirPtr (  )  [inline]
const IODir* IOMan::dirPtr (  )  const [inline]
void IOMan::disallowSurveyChange (  )  [inline]
static void IOMan::enableSurveyChangeTriggers ( bool   )  [static]

if set to true, survey change notifiers will be triggered

const char* IOMan::generateFileName ( Translator ,
const char *   
)
IOObj* IOMan::get ( const MultiID  )  const

Next functions return a new (unmanaged) IOObj.

IOObj* IOMan::getByName ( const char *  objname,
const char *  partrgname = 0,
const char *  parname = 0 
)
void IOMan::getEntry ( CtxtIOObj ,
bool  newistmp = false 
)

will create a new entry if necessary

IOObj* IOMan::getFirst ( const IOObjContext ,
int *  nrpresent = 0 
) const

if interested in nrpresent pass valid address

IOObj* IOMan::getIfOnlyOne ( const char *  trgroupname  )  [inline]
IOObj* IOMan::getLocal ( const char *  objname  )  const
IOObj* IOMan::getOfGroup ( const char *  tgname,
bool  first = true,
bool  onlyifsingle = false 
) const
bool IOMan::haveEntries ( const MultiID dirid,
const char *  trgrpnm = 0,
const char *  trnm = 0 
) const
void IOMan::init (  )  [private]
bool IOMan::isReady (  )  const
MultiID IOMan::key (  )  const

of current IODir

int IOMan::levelOf ( const char *  dirnm  )  const
const char* IOMan::nameOf ( const char *  keystr,
bool  inc_parents = false 
) const
MultiID IOMan::newKey (  )  const
static bool IOMan::newSurvey (  )  [static]

if an external source has changed the .od/survey, force re-read it.

bool IOMan::permRemove ( const MultiID  ) 
const char* IOMan::rootDir (  )  const [inline]
bool IOMan::setDir ( const char *   )  [private]
bool IOMan::setFileName ( MultiID  ,
const char *   
)
bool IOMan::setRootDir ( const char *   ) 
static bool IOMan::setSurvey ( const char *   )  [static]

will remove existing IO manager and set the survey to 'name', thus bypassing the .od/survey file

static void IOMan::setupCustomDataDirs ( int   )  [static, private]
const char* IOMan::surveyName (  )  const
bool IOMan::to ( const MultiID  ) 
bool IOMan::to ( const IOLink  ) 

NULL -> up-dir.

static bool IOMan::validSurveySetup ( BufferString errmsg  )  [static]

Friends And Related Function Documentation

friend class IODir [friend]
mGlobal IOMan& IOM (  )  [friend]
friend class IOObj [friend]

Member Data Documentation

bool IOMan::canchangesurvey_ [private]
int IOMan::curlvl [private]
IODir* IOMan::dirptr [private]
FileNameString IOMan::rootdir [private]
State IOMan::state_ [private]
IOMan* IOMan::theinst_ [static, private]