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

#include <Design.hpp>

+ Inheritance diagram for torc::generic::Design::Factory:
+ Collaboration diagram for torc::generic::Design::Factory:

Public Types

typedef Design Type
 
typedef SelfReferencing< Type >
::Pointer 
Pointer
 
typedef SelfReferencing< Type >
::WeakPointer 
WeakPointer
 

Public Member Functions

virtual DesignSharedPtr newDesignPtr (const std::string &inName, const RootSharedPtr &inRootPtr, const std::string &inCellRefName, const std::string &inLibraryRefName, const std::string &inOriginalName=std::string()) throw (Error)
 
virtual void create (Pointer &outPointer) throw (Error)
 

Detailed Description

Convenience class for creating a design

Definition at line 60 of file generic/Design.hpp.

Member Typedef Documentation

A pointer to an object of type Type

Definition at line 45 of file FactoryType.hpp.

A rename of the parameter type

Definition at line 40 of file FactoryType.hpp.

A weak pointer to an object of type Type

Definition at line 50 of file FactoryType.hpp.

Member Function Documentation

virtual void torc::generic::FactoryType< Design >::create ( Pointer outPointer)
throw (Error
)
inlinevirtualinherited

Create an object of the Type specification of Factory. If the object has a boost::weak_ptr to itself, it is the task of this method to set this after the object is created.

Returns
A pointer to the freshly created object.

Definition at line 58 of file FactoryType.hpp.

58  {
59  try {
60  Pointer temp(new _Tp()); //Do not remove
61  outPointer = temp;
62  WeakPointer weakPtr(outPointer);
63  outPointer->setWeakThis(weakPtr);
64  } catch(std::exception& e) //May receive std::bad_alloc
65  {
66  //TBD::ERROR
67  }
68  }
SelfReferencing< Type >::WeakPointer WeakPointer
Definition: FactoryType.hpp:50
SelfReferencing< Type >::Pointer Pointer
Definition: FactoryType.hpp:45
DesignSharedPtr torc::generic::Design::Factory::newDesignPtr ( const std::string &  inName,
const RootSharedPtr inRootPtr,
const std::string &  inCellRefName,
const std::string &  inLibraryRefName,
const std::string &  inOriginalName = std::string() 
)
throw (Error
)
virtual

Create a design

Parameters
[in]inNameName of the design to be created.
[in]inRootPtrPointer to parented(Root) object.
[in]inCellRefNameThe top level cell ref name for this design.
[in]inLibraryRefNameThe top level Library ref name for this design.
[in]inOriginalNameOriginal name of the design [optional].
Returns
Pointer to created design.

Definition at line 25 of file generic/Design.cpp.

27  {
28  try {
29  DesignSharedPtr newDesign;
30  create(newDesign);
31  newDesign->setName(inName);
32  newDesign->setParent(inRootPtr);
33  inRootPtr->addDesign(newDesign);
34  newDesign->setCellRefName(inCellRefName);
35  newDesign->setLibraryRefName(inLibraryRefName);
36  newDesign->setOriginalName(inOriginalName);
37  return newDesign;
38  } catch(Error& e) {
39  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
40  throw;
41  }
42 }
virtual void create(Pointer &outPointer)
Definition: FactoryType.hpp:58
boost::shared_ptr< Design > DesignSharedPtr

+ Here is the call graph for this function:


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