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

#include <OperationTriggeredField.hh>

Inheritance diagram for OperationTriggeredField:
Inheritance graph
Collaboration diagram for OperationTriggeredField:
Collaboration graph

Public Member Functions

 OperationTriggeredField (const ObjectState *state, OperationTriggeredEncoding &parent)
 
 OperationTriggeredField (OperationTriggeredEncoding &parent, int piece, int start, int width)
 
int piece () const
 
void setPiece (int piece)
 
int start () const
 
void setStart (int start)
 
virtual void loadState (const ObjectState *state)
 
virtual ObjectStatesaveState () const
 
virtual int childFieldCount () const
 
virtual int width () const
 
void setWidth (int width)
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 

Static Public Attributes

static const std::string OSNAME_FIELD = "ota-field"
 
static const std::string OSKEY_PIECE_NAME = "piece"
 
static const std::string OSKEY_START_NAME = "start"
 
static const std::string OSKEY_WIDTH_NAME = "width"
 

Private Attributes

int piece_
 
int start_
 
int width_
 

Detailed Description

Definition at line 43 of file OperationTriggeredField.hh.

Constructor & Destructor Documentation

◆ OperationTriggeredField() [1/2]

OperationTriggeredField::OperationTriggeredField ( const ObjectState state,
OperationTriggeredEncoding parent 
)

The constructor

Loads the state of the field encoding from the given ObjectState tree

Parameters
stateThe ObjectState tree
parentThe parent operation triggered encoding
Exceptions
ObjectStateLoadingExceptionIf an error occurs while loading the state.

Definition at line 69 of file OperationTriggeredField.cc.

70 {
71 parent.addField(*this);
72 loadState(state);
73}
void addField(OperationTriggeredField &field)
virtual void loadState(const ObjectState *state)

References OperationTriggeredEncoding::addField(), and loadState().

Here is the call graph for this function:

◆ OperationTriggeredField() [2/2]

OperationTriggeredField::OperationTriggeredField ( OperationTriggeredEncoding parent,
int  piece,
int  start,
int  width 
)

The constructor.

Registers the field encoding to the parent binary encoding automatically.

Parameters
parentThe parent binaryEncoding.

Definition at line 51 of file OperationTriggeredField.cc.

References OperationTriggeredEncoding::addField().

Here is the call graph for this function:

Member Function Documentation

◆ childFieldCount()

int OperationTriggeredField::childFieldCount ( ) const
virtual

Always returns 0 because field encoding does not have any child fields.

Returns
0

Definition at line 115 of file OperationTriggeredField.cc.

115 {
116 return 0;
117}

◆ loadState()

void OperationTriggeredField::loadState ( const ObjectState state)
virtual

Loads the state of the field encoding from the given ObjectState tree.

Parameters
stateThe ObjectState tree.
Exceptions
ObjectStateLoadingExceptionIf an error occurs while loading the state.

Implements Serializable.

Definition at line 145 of file OperationTriggeredField.cc.

145 {
146 ObjectState* newState = new ObjectState(*state);
147
148 try {
152
153 } catch (const Exception& exception) {
154 const std::string procName = "OperationTriggeredField::loadState";
156 __FILE__, __LINE__, procName, exception.errorMessage());
157 }
158
159 delete newState;
160}
std::string errorMessage() const
Definition Exception.cc:123
int intAttribute(const std::string &name) const
static const std::string OSKEY_PIECE_NAME
static const std::string OSKEY_START_NAME
static const std::string OSKEY_WIDTH_NAME

References Exception::errorMessage(), ObjectState::intAttribute(), OSKEY_PIECE_NAME, OSKEY_START_NAME, OSKEY_WIDTH_NAME, piece_, start_, and width_.

Referenced by OperationTriggeredField().

Here is the call graph for this function:

◆ piece()

int OperationTriggeredField::piece ( ) const

Returns the piece index that indicates the index of the encoding piece.

Returns
The encoding piece index.

Definition at line 82 of file OperationTriggeredField.cc.

82 {
83 return piece_;
84}

References piece_.

Referenced by setPiece().

◆ saveState()

ObjectState * OperationTriggeredField::saveState ( ) const
virtual

Saves the state of the field encoding to an ObjectState tree.

Returns
The newly created ObjectState tree.

Implements Serializable.

Definition at line 170 of file OperationTriggeredField.cc.

170 {
175
176 return state;
177}
void setAttribute(const std::string &name, const std::string &value)
static const std::string OSNAME_FIELD

References OSKEY_PIECE_NAME, OSKEY_START_NAME, OSKEY_WIDTH_NAME, OSNAME_FIELD, piece_, ObjectState::setAttribute(), start_, and width_.

Referenced by OperationTriggeredEncoding::saveState().

Here is the call graph for this function:

◆ setPiece()

void OperationTriggeredField::setPiece ( int  piece)

Definition at line 87 of file OperationTriggeredField.cc.

87 {
88 piece_ = piece;
89}

References piece(), and piece_.

Here is the call graph for this function:

◆ setStart()

void OperationTriggeredField::setStart ( int  start)

Definition at line 103 of file OperationTriggeredField.cc.

103 {
104 start_ = start;
105}

References start(), and start_.

Here is the call graph for this function:

◆ setWidth()

void OperationTriggeredField::setWidth ( int  width)

Definition at line 131 of file OperationTriggeredField.cc.

131 {
132 width_ = width;
133}

References width(), and width_.

Here is the call graph for this function:

◆ start()

int OperationTriggeredField::start ( ) const

Returns the piece index that indicates the index of the encoding piece.

Returns
The encoding piece index.

Definition at line 98 of file OperationTriggeredField.cc.

98 {
99 return start_;
100}

References start_.

Referenced by setStart().

◆ width()

int OperationTriggeredField::width ( ) const
virtual

Returns the bit width of the field encoding

Returns
The bit width of the field encoding.

Definition at line 126 of file OperationTriggeredField.cc.

126 {
127 return width_;
128}

References width_.

Referenced by setWidth(), and OperationTriggeredEncoding::width().

Member Data Documentation

◆ OSKEY_PIECE_NAME

const std::string OperationTriggeredField::OSKEY_PIECE_NAME = "piece"
static

Definition at line 66 of file OperationTriggeredField.hh.

Referenced by loadState(), and saveState().

◆ OSKEY_START_NAME

const std::string OperationTriggeredField::OSKEY_START_NAME = "start"
static

Definition at line 67 of file OperationTriggeredField.hh.

Referenced by loadState(), and saveState().

◆ OSKEY_WIDTH_NAME

const std::string OperationTriggeredField::OSKEY_WIDTH_NAME = "width"
static

Definition at line 68 of file OperationTriggeredField.hh.

Referenced by loadState(), and saveState().

◆ OSNAME_FIELD

const std::string OperationTriggeredField::OSNAME_FIELD = "ota-field"
static

Definition at line 65 of file OperationTriggeredField.hh.

Referenced by OperationTriggeredEncoding::loadState(), and saveState().

◆ piece_

int OperationTriggeredField::piece_
private

Definition at line 71 of file OperationTriggeredField.hh.

Referenced by loadState(), piece(), saveState(), and setPiece().

◆ start_

int OperationTriggeredField::start_
private

Definition at line 72 of file OperationTriggeredField.hh.

Referenced by loadState(), saveState(), setStart(), and start().

◆ width_

int OperationTriggeredField::width_
private

Definition at line 73 of file OperationTriggeredField.hh.

Referenced by loadState(), saveState(), setWidth(), and width().


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