This abstract class defines the interface for a factory that can generate NxsBlocks. More...
Public Member Functions
|virtual NxsBlock *||GetBlockReaderForID (const std::string &id, NxsReader *reader, NxsToken *token)=0|
|virtual void||BlockError (NxsBlock *b)|
|virtual void||BlockSkipped (NxsBlock *b)|
This abstract class defines the interface for a factory that can generate NxsBlocks.
When the NxsReader::Execute() method encounters a block that it needs to handle, it will first check the registered "singelton" blocks (a block that has been added to it using NxsReader::Add(), those NxsBlock instances are recycled). If no singleton block says that it can read that block of NEXUS (see NxsBlock::CanReadBlockType()), then the NxsReader will walk through its list of factories calling NxsBlockFactory::GetBlockReaderForID() for each until it gets a non-NULL pointer.
If there is an exception during the parsing of that block BlockError will be called for the factory instance that generated the block
Blocks generated by factories but used successfully in a parse have to be deleted by the client code (See Managing Memory discussion).