torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::generic::EdifImporter Class Reference

#include <Generic.hpp>

+ Inheritance diagram for torc::generic::EdifImporter:
+ Collaboration diagram for torc::generic::EdifImporter:

Public Member Functions

 EdifImporter (ObjectFactorySharedPtr &inObjectFactoryPtr)
 
virtual ~EdifImporter (void) throw ()
 
void operator() (std::ostream &inStream, std::string &inName)
 
RootSharedPtr getRootPtr (void)
 
void parse (const std::string &inFileName, const RootSharedPtr &outRoot, const LinkerSharedPtr &outLinker, const ObjectFactorySharedPtr &inFactory, const ParserOptions &inOptions) throw (Error)
 
void parse (const std::vector< std::string > &inFileNames, const RootSharedPtr &outRoot, const LinkerSharedPtr &outLinker, const ObjectFactorySharedPtr &inFactory, const ParserOptions &inOptions) throw (Error)
 

Protected Attributes

ObjectFactorySharedPtr mObjectFactoryPtr
 
RootSharedPtr mRootPtr
 

Detailed Description

Definition at line 148 of file Generic.hpp.

Constructor & Destructor Documentation

torc::generic::EdifImporter::EdifImporter ( ObjectFactorySharedPtr inObjectFactoryPtr)
inline

Definition at line 153 of file Generic.hpp.

154  : mObjectFactoryPtr(inObjectFactoryPtr), mRootPtr(inObjectFactoryPtr->newRootPtr("new")) {}
ObjectFactorySharedPtr mObjectFactoryPtr
Definition: Generic.hpp:150
virtual torc::generic::EdifImporter::~EdifImporter ( void  )
throw (
)
inlinevirtual

Definition at line 155 of file Generic.hpp.

155 {}

Member Function Documentation

RootSharedPtr torc::generic::EdifImporter::getRootPtr ( void  )
inline

Definition at line 162 of file Generic.hpp.

162 { return mRootPtr; }

+ Here is the caller graph for this function:

void torc::generic::EdifImporter::operator() ( std::ostream &  inStream,
std::string &  inName 
)
inline

Definition at line 156 of file Generic.hpp.

156  {
157  mRootPtr->setName(inName);
158  LinkerSharedPtr linkerPtr(new Linker(mRootPtr));
159  ParserOptions options;
160  parse(inName, mRootPtr, linkerPtr, mObjectFactoryPtr, options);
161  }
boost::shared_ptr< Linker > LinkerSharedPtr
void parse(const std::string &inFileName, const RootSharedPtr &outRoot, const LinkerSharedPtr &outLinker, const ObjectFactorySharedPtr &inFactory, const ParserOptions &inOptions)
Definition: EdifParser.cpp:40
ObjectFactorySharedPtr mObjectFactoryPtr
Definition: Generic.hpp:150

+ Here is the call graph for this function:

void torc::generic::EdifParser::parse ( const std::string &  inFileName,
const RootSharedPtr outRoot,
const LinkerSharedPtr outLinker,
const ObjectFactorySharedPtr inFactory,
const ParserOptions inOptions 
)
throw (Error
)
inherited

Parse a given edif file

Parameters
[in]inFileNameName of file to be parsed
[out]outRootRoot to be populated
[out]outLinkerLinker to be used for this parse
[in]inFactoryFactory object to be used for parsing
[in]inOptionsOptions to the parser

Definition at line 40 of file EdifParser.cpp.

42  {
43  EdifContextSharedPtr context(new EdifContext(outRoot, outLinker, inFactory, inOptions));
44  if(!outRoot || !outLinker || !inFactory) {
45  Error e(eMessageIdErrorNullPointer, __FUNCTION__, __FILE__, __LINE__);
46  throw;
47  }
48  Driver parserDriver(context);
49  if(false == parserDriver.parseFile(inFileName)) {
50  throw parserDriver.getParserError();
51  }
52  return;
53 }
boost::shared_ptr< EdifContext > EdifContextSharedPtr

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::generic::EdifParser::parse ( const std::vector< std::string > &  inFileNames,
const RootSharedPtr outRoot,
const LinkerSharedPtr outLinker,
const ObjectFactorySharedPtr inFactory,
const ParserOptions inOptions 
)
throw (Error
)
inherited

Parse a given set of edif files

Parameters
[in]inFileNamesNames of file to be parsed
[out]outRootRoot to be populated
[out]outLinkerLinker to be used for this parse
[in]inFactoryFactory object to be used for parsing
[in]inOptionsOptions to the parser

Definition at line 55 of file EdifParser.cpp.

57  {
58  std::vector<std::string>::const_iterator it = inFileNames.begin();
59  std::vector<std::string>::const_iterator end = inFileNames.end();
60  try {
61  for(; it != end; ++it) {
62  parse(*it, outRoot, outLinker, inFactory, inOptions);
63  }
64  } catch(Error& e) {
65  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
66  throw;
67  }
68 }
void parse(const std::string &inFileName, const RootSharedPtr &outRoot, const LinkerSharedPtr &outLinker, const ObjectFactorySharedPtr &inFactory, const ParserOptions &inOptions)
Definition: EdifParser.cpp:40

+ Here is the call graph for this function:

Field Documentation

ObjectFactorySharedPtr torc::generic::EdifImporter::mObjectFactoryPtr
protected

Definition at line 150 of file Generic.hpp.

RootSharedPtr torc::generic::EdifImporter::mRootPtr
protected

Definition at line 151 of file Generic.hpp.


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