torc::generic::Linker Class Reference

Represents a repository of unresolved usage references. More...

#include <Linker.hpp>

List of all members.

Public Types

typedef boost::shared_ptr
< UnresolvedInstances
UnresolvedInstancesPtr
typedef SymTab< NameSpec,
UnresolvedInstancesPtr > 
UnresolvedInfoMap

Public Member Functions

ViewSharedPtr findExternView (const NameSpec &inNameSpec) throw ()
void setExternView (const NameSpec &inNameSpec, const ViewSharedPtr &inExternView) throw ()
bool findUnresolvedInstances (const NameSpec &inNameSpec, UnresolvedInstancesPtr &outInstances) throw (Error)
void registerUnresolvedInstance (const NameSpec &inNameSpec, const InstanceSharedPtr &inInstance) throw (Error)
void removeUnresolvedInstances (const NameSpec &inNameSpec) throw (Error)
void linkUnresolved (const NameSpec &inNameSpec, ViewSharedPtr &inView) throw (Error)
 Linker (const RootSharedPtr &root)
 Linker (const Linker &source)
Linkeroperator= (const Linker &inSource) throw ()

Private Attributes

RootSharedPtr mRoot
UnresolvedInfoMap mInfos

Classes

class  NameSpec
class  UnresolvedInstances


Detailed Description

Represents a repository of unresolved usage references.

The Linker class represents a repository of unresolved instances, that is instances that are yet to to be linked to concrete veiws. When an instance is created by the parser, it tries to find a concrete view using the name specification present in the EDIF file. If no such references were found, the instance is attached to a Extern view, that is a view that is only a place holder. As newer cells are discovered by the parser, the unresolved instances are linked to the concrete views and removed from the linker.

Note:
This class is typically used by EdifParser.

Definition at line 46 of file Linker.hpp.


Constructor & Destructor Documentation

torc::generic::Linker::Linker ( const RootSharedPtr &  inRoot  ) 

Constructor

Parameters:
[in] root Root of the OM.

Definition at line 263 of file Linker.cpp.


Member Function Documentation

ViewSharedPtr torc::generic::Linker::findExternView ( const NameSpec inNameSpec  )  throw ()

Find the extern View if already present.

Parameters:
[in] inNameSpec Name of the view
Returns:
Extern view
Find the extern View if already present. Otherwise null

Parameters:
[in] inNameSpec Name of the view
Returns:
Extern view

Definition at line 156 of file Linker.cpp.

void torc::generic::Linker::setExternView ( const NameSpec inNameSpec,
const ViewSharedPtr &  inExternView 
) throw ()

Set an extern View

Parameters:
[in] inNameSpec Name of the view
[in] inExternView an Extern View
Set an extern View

Parameters:
[in] inNameSpec Name of the view
[in] externView an Extern View

Definition at line 174 of file Linker.cpp.

bool torc::generic::Linker::findUnresolvedInstances ( const NameSpec inNameSpec,
Linker::UnresolvedInstancesPtr &  outInstances 
) throw (Error)

Find the list of instances that are waiting for a view with the specified name.

Parameters:
[in] inNameSpec Name of the view to be linked with.
[out] outInstances Pointer to unresolved object
Returns:
True if any such instances exist
Find the list of instances that are waiting for a view with the specified name.

Parameters:
[in] inNameSpec Name of the view to be linked with.
[out] outInstances Pointer to unresolved object
Returns:
True if such instance exists

Definition at line 197 of file Linker.cpp.

void torc::generic::Linker::registerUnresolvedInstance ( const NameSpec inNameSpec,
const InstanceSharedPtr &  inInstance 
) throw (Error)

Add an instance to the list of unresolved instances for a given name specification. If a new UnresolvedInstances object is to be created, this method will also call the setExternView() method to update the externView, with the view set for this object.

Parameters:
[in] inNameSpec name specification for a view.
[in] inInstance instance to be added.
Exceptions:
Error The master for this instance is not an extern or no extern is set for this view.

Definition at line 212 of file Linker.cpp.

void torc::generic::Linker::removeUnresolvedInstances ( const NameSpec inNameSpec  )  throw (Error)

Remove all unresolved objects for the given name specification.

Parameters:
[in] inNameSpec Name specification

Definition at line 232 of file Linker.cpp.

void torc::generic::Linker::linkUnresolved ( const NameSpec inNameSpec,
ViewSharedPtr &  inView 
) throw (Error)

Resolves all unlinked references for the given namespec to the given view

Parameters:
[in] inNameSpec Name specification for unresolved view
[in] inView View to be bound to

Definition at line 238 of file Linker.cpp.


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

Generated on Thu Oct 13 16:50:40 2011 for TORC by  doxygen 1.5.6