A.I.M.S


aims::AimsGraphWriter Class Reference

#include <aims/io/aimsGraphW.h>

Inheritance diagram for aims::AimsGraphWriter:
Collaboration diagram for aims::AimsGraphWriter:

Classes

struct  ElementInfo
 
struct  ObjectWrapper
 
struct  Wrapper
 

Public Types

enum  SavingMode { Keep, Global, Local }
 
- Public Types inherited from aims::Process
typedef bool(* ProcFunc )(Process &, const std::string &, Finder &)
 Process function type. More...
 

Public Member Functions

 AimsGraphWriter (const std::string &filename)
 
virtual ~AimsGraphWriter ()
 
virtual void writeElements (Graph &g, SavingMode newmode=Keep, SavingMode oldmode=Keep, bool saveOnlyModified=false)
 Saves elements contained in the graph. More...
 
const ElementInfoelementInfo () const
 
ElementInfoelementInfo ()
 
- Public Member Functions inherited from aims::Process
 Process ()
 Attempts to read the header of filename and, if successful, calls the operator() of the process . More...
 
virtual ~Process ()
 
void registerProcessType (const std::string &objType, const std::string &dataType, ProcFunc procFunc)
 Registers the process to call on a given (object type, data type) couple (just fills the map) More...
 
bool execute (const std::string &filename)
 Executes the process on the object / data type found in the given file. More...
 
bool execute (Finder &f, const std::string &filename)
 Same as above but the header has already been read (or hand-made to fake it!) More...
 
const std::map< std::string,
std::map< std::string,
ProcFunc > > & 
processTypes () const
 Query registered process types. More...
 
void setReadOptions (carto::Object options)
 Set reading options. More...
 

Static Public Member Functions

template<class T >
static bool defaultTakeObject (Process &, const std::string &, Finder &)
 

Friends

template<typename T >
struct ObjectWrapper
 

Additional Inherited Members

- Protected Attributes inherited from aims::Process
std::map< std::string,
std::map< std::string,
ProcFunc > > 
_execs
 
carto::Object _options
 

Detailed Description

Definition at line 55 of file aimsGraphW.h.

Member Enumeration Documentation

Enumerator
Keep 
Global 
Local 

Definition at line 58 of file aimsGraphW.h.

Constructor & Destructor Documentation

aims::AimsGraphWriter::AimsGraphWriter ( const std::string &  filename)
virtual aims::AimsGraphWriter::~AimsGraphWriter ( )
virtual

Member Function Documentation

template<class T >
bool aims::AimsGraphWriter::defaultTakeObject ( Process p,
const std::string &  ,
Finder  
)
static
const ElementInfo& aims::AimsGraphWriter::elementInfo ( ) const
inline

Definition at line 130 of file aimsGraphW.h.

ElementInfo& aims::AimsGraphWriter::elementInfo ( )
inline

Definition at line 131 of file aimsGraphW.h.

virtual void aims::AimsGraphWriter::writeElements ( Graph g,
SavingMode  newmode = Keep,
SavingMode  oldmode = Keep,
bool  saveOnlyModified = false 
)
virtual

Saves elements contained in the graph.

Elements must be referred by the aims_objects_table map. Input graph g is not const since some of the graph attributed are updated. Hence you must always call writeElements() before saving the graph structure (using a regular GraphWriter)

Todo:

save only some objects

save only modified objects

newmode saving mode of "new" objects (those created after loading)
oldmode saving mode of already existing (loaded) objects
saveOnlyModified : if true, saves only objects in graph elements
with a modification flag (attribute "modified" set to true)

Friends And Related Function Documentation

template<typename T >
friend struct ObjectWrapper
friend

Definition at line 106 of file aimsGraphW.h.


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