OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
StateLocator Class Reference

#include <StateLocator.hh>

Collaboration diagram for StateLocator:
Collaboration graph

Public Member Functions

 StateLocator ()
 
virtual ~StateLocator ()
 
void addState (const TTAMachine::MachinePart &momComponent, StateData &state)
 
StateDatastate (const TTAMachine::MachinePart &momComponent) const
 

Private Types

typedef std::map< const TTAMachine::MachinePart *, StateData * > StateContainer
 State objects indexed by MOM components.
 

Private Member Functions

 StateLocator (const StateLocator &)
 Copying not allowed.
 
StateLocatoroperator= (const StateLocator &)
 Assignment not allowed.
 

Private Attributes

StateContainer states_
 Contains all the states indexed by MOM components.
 

Detailed Description

Class that makes it possible to lookup state objects corresponding to MOM component instances.

Definition at line 51 of file StateLocator.hh.

Member Typedef Documentation

◆ StateContainer

State objects indexed by MOM components.

Definition at line 69 of file StateLocator.hh.

Constructor & Destructor Documentation

◆ StateLocator() [1/2]

StateLocator::StateLocator ( )

Constructor.

Definition at line 45 of file StateLocator.cc.

45 {
46}

◆ ~StateLocator()

StateLocator::~StateLocator ( )
virtual

Destructor.

Definition at line 51 of file StateLocator.cc.

51 {
52}

◆ StateLocator() [2/2]

StateLocator::StateLocator ( const StateLocator )
private

Copying not allowed.

Member Function Documentation

◆ addState()

void StateLocator::addState ( const TTAMachine::MachinePart momComponent,
StateData state 
)

Adds state to to StateLocator.

Parameters
momComponentMachine object model component.
stateMachine state model state.

Definition at line 61 of file StateLocator.cc.

61 {
62 StateContainer::iterator iter = states_.find(&momComponent);
63 if (iter != states_.end()) {
64 (*iter).second = &state;
65 } else {
66 states_[&momComponent] = &state;
67 }
68}
StateContainer states_
Contains all the states indexed by MOM components.
StateData & state(const TTAMachine::MachinePart &momComponent) const

References state(), and states_.

Referenced by MachineStateBuilder::addPortToFU(), and MachineStateBuilder::buildMachineState().

Here is the call graph for this function:

◆ operator=()

StateLocator & StateLocator::operator= ( const StateLocator )
private

Assignment not allowed.

◆ state()

StateData & StateLocator::state ( const TTAMachine::MachinePart momComponent) const

Returns state corresponding to the given component.

Parameters
momComponentComponent.
Returns
State corresponding to given component.
Exceptions
IllegalParametersIf state is not found.

Definition at line 78 of file StateLocator.cc.

78 {
79 StateContainer::const_iterator iter = states_.find(&momComponent);
80 if (iter == states_.end()) {
81 string msg = "State corresponding to component not found";
82 throw IllegalParameters(__FILE__, __LINE__, __func__, msg);
83 }
84
85 return *((*iter).second);
86}
#define __func__

References __func__, and states_.

Referenced by addState().

Member Data Documentation

◆ states_

StateContainer StateLocator::states_
private

Contains all the states indexed by MOM components.

Definition at line 72 of file StateLocator.hh.

Referenced by addState(), and state().


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