OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
TTAMachine::UnconditionalGuard Class Reference

#include <Guard.hh>

Inheritance diagram for TTAMachine::UnconditionalGuard:
Inheritance graph
Collaboration diagram for TTAMachine::UnconditionalGuard:
Collaboration graph

Public Member Functions

 UnconditionalGuard (bool inverted, Bus &parentBus)
 
 UnconditionalGuard (const ObjectState *state, Bus &parentBus)
 
virtual ~UnconditionalGuard ()
 
bool isOpposite (const Guard &) const
 
bool isEqual (const Guard &guard) const
 
ObjectStatesaveState () const
 
void loadState (const ObjectState *state)
 
virtual void copyTo (Bus &parentBus) const
 
- Public Member Functions inherited from TTAMachine::Guard
virtual ~Guard ()
 
virtual BusparentBus () const
 
virtual void setParentBus (Bus *parentBus)
 
virtual bool isInverted () const
 
virtual bool isMoreRestrictive (const Guard &guard) const
 
virtual bool isLessRestrictive (const Guard &guard) const
 
virtual bool isDisjoint (const Guard &guard) const
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 

Static Public Attributes

static const std::string OSNAME_UNCONDITIONAL_GUARD = "unconditional"
 ObjectState name for UnconditionalGuard.
 
- Static Public Attributes inherited from TTAMachine::Guard
static const std::string OSNAME_GUARD = "guard"
 ObjectState name for guard.
 
static const std::string OSKEY_INVERTED = "inverted"
 ObjectState attribute key for inverted feature.
 

Additional Inherited Members

- Protected Member Functions inherited from TTAMachine::Guard
 Guard (bool inverted, Bus *parentBus)
 
 Guard (const ObjectState *state, Bus &parentBus)
 
- Protected Member Functions inherited from TTAMachine::SubComponent
 SubComponent ()
 
virtual ~SubComponent ()
 
- Protected Member Functions inherited from TTAMachine::MachinePart
 MachinePart ()
 
virtual ~MachinePart ()
 

Detailed Description

Always true guard term. Always false if inverted.

Definition at line 180 of file Guard.hh.

Constructor & Destructor Documentation

◆ UnconditionalGuard() [1/2]

TTAMachine::UnconditionalGuard::UnconditionalGuard ( bool  inverted,
Bus parentBus 
)

Constructor.

Parameters
invertedIf true, the guard condition is always false and vice versa.
parentBusParent bus component of the guard.
Exceptions
ComponentAlreadyExistsIf the parent bus already has an equal guard.

Definition at line 615 of file Guard.cc.

616 : Guard(inverted, &parentBus) {
617 parentBus.addGuard(*this);
618}
void addGuard(Guard &guard)
Definition Bus.cc:410
virtual Bus * parentBus() const
Guard(bool inverted, Bus *parentBus)
Definition Guard.cc:64

References TTAMachine::Bus::addGuard(), and TTAMachine::Guard::parentBus().

Here is the call graph for this function:

◆ UnconditionalGuard() [2/2]

TTAMachine::UnconditionalGuard::UnconditionalGuard ( const ObjectState state,
Bus parentBus 
)

Constructor.

Loads its state from the given ObjectState instance.

Parameters
stateThe ObjectState instance.
parentBusThe parent bus of the guard.
Exceptions
ObjectStateLoadingExceptionIf the given ObjectState instance is invalid.

Definition at line 630 of file Guard.cc.

631 : Guard(state, parentBus) {
632 loadState(state);
633 try {
634 parentBus.addGuard(*this);
635 } catch (const ComponentAlreadyExists&) {
636 const string procName = "UnconditionalGuard::UnconditionalGuard";
637 MOMTextGenerator textGen;
638 format errorMsg = textGen.text(
640 errorMsg % parentBus.name();
642 __FILE__, __LINE__, procName, errorMsg.str());
643 }
644}
virtual TCEString name() const
void loadState(const ObjectState *state)
Definition Guard.cc:696
virtual boost::format text(int textId)

References TTAMachine::Bus::addGuard(), loadState(), TTAMachine::Component::name(), TTAMachine::Guard::parentBus(), Texts::TextGenerator::text(), and MOMTextGenerator::TXT_EQUAL_UNCONDITIONAL_GUARDS.

Here is the call graph for this function:

◆ ~UnconditionalGuard()

TTAMachine::UnconditionalGuard::~UnconditionalGuard ( )
virtual

Destructor.

Definition at line 649 of file Guard.cc.

649 {
650}

Member Function Documentation

◆ copyTo()

virtual void TTAMachine::UnconditionalGuard::copyTo ( Bus parentBus) const
inlinevirtual

Implements TTAMachine::Guard.

Definition at line 190 of file Guard.hh.

190 {
192 }
virtual bool isInverted() const
UnconditionalGuard(bool inverted, Bus &parentBus)
Definition Guard.cc:615

References TTAMachine::Guard::isInverted(), and TTAMachine::Guard::parentBus().

Here is the call graph for this function:

◆ isEqual()

bool TTAMachine::UnconditionalGuard::isEqual ( const Guard guard) const
virtual

Returns true if the guard is equal with the given guard.

Parameters
guardThe other guard.
Returns
True if the guard is equal with the given guard.

Implements TTAMachine::Guard.

Definition at line 660 of file Guard.cc.

660 {
661 const UnconditionalGuard* ucGuard =
662 dynamic_cast<const UnconditionalGuard*>(&guard);
663 if (ucGuard == NULL) {
664 return false;
665 } else {
666 if (isInverted() == ucGuard->isInverted()) {
667 return true;
668 } else {
669 return false;
670 }
671 }
672}

References TTAMachine::Guard::isInverted().

Here is the call graph for this function:

◆ isOpposite()

bool TTAMachine::UnconditionalGuard::isOpposite ( const Guard ) const
inlinevirtual

Implements TTAMachine::Guard.

Definition at line 186 of file Guard.hh.

186{ return false; }

◆ loadState()

void TTAMachine::UnconditionalGuard::loadState ( const ObjectState state)
virtual

Loads its state from the given ObjectState instance.

Parameters
stateThe ObjectState instance.
Exceptions
ObjectStateLoadingExceptionIf the given ObjectState instance is invalid.

Reimplemented from TTAMachine::Guard.

Definition at line 696 of file Guard.cc.

696 {
697 string procName = "UnconditionalGuard::loadState";
698
699 if (state->name() != OSNAME_UNCONDITIONAL_GUARD) {
700 throw ObjectStateLoadingException(__FILE__, __LINE__, procName);
701 }
702
703 Guard::loadState(state);
704}
std::string name() const
virtual void loadState(const ObjectState *state)
Definition Guard.cc:164
static const std::string OSNAME_UNCONDITIONAL_GUARD
ObjectState name for UnconditionalGuard.
Definition Guard.hh:195

References TTAMachine::Guard::loadState(), ObjectState::name(), and OSNAME_UNCONDITIONAL_GUARD.

Referenced by UnconditionalGuard().

Here is the call graph for this function:

◆ saveState()

ObjectState * TTAMachine::UnconditionalGuard::saveState ( ) const
virtual

Saves the contents to an ObjectState object.

Returns
The created ObjectState object.

Reimplemented from TTAMachine::Guard.

Definition at line 681 of file Guard.cc.

681 {
682 ObjectState* guardState = Guard::saveState();
684 return guardState;
685}
void setName(const std::string &name)
virtual ObjectState * saveState() const
Definition Guard.cc:149

References OSNAME_UNCONDITIONAL_GUARD, TTAMachine::Guard::saveState(), and ObjectState::setName().

Here is the call graph for this function:

Member Data Documentation

◆ OSNAME_UNCONDITIONAL_GUARD

const string TTAMachine::UnconditionalGuard::OSNAME_UNCONDITIONAL_GUARD = "unconditional"
static

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