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

#include <OperationModule.hh>

Inheritance diagram for OperationModule:
Inheritance graph
Collaboration diagram for OperationModule:
Collaboration graph

Public Member Functions

 OperationModule (const std::string &name, const std::string &path)
 
 OperationModule (const OperationModule &om)
 
virtual ~OperationModule ()
 
OperationModuleoperator= (const OperationModule &om)
 
virtual std::string name () const
 
virtual bool definesBehavior () const
 
virtual std::string behaviorModule () const
 
virtual std::string propertiesModule () const
 
virtual bool hasBehaviorSource () const
 
virtual std::string behaviorSourceModule () const
 

Private Member Functions

std::string propertyFileName () const
 
std::string behaviorFileName () const
 
std::string behaviorSourceFileName () const
 

Private Attributes

std::string path_
 The path of the module.
 
std::string name_
 The name of the module.
 

Static Private Attributes

static const std::string PROPERTY_FILE_EXTENSION = ".opp"
 File extension of operation property file.
 
static const std::string BEHAVIOR_FILE_EXTENSION = ".opb"
 File extension of operation behavior file.
 
static const std::string BEHAVIOR_SOURCE_FILE_EXTENSION = ".cc"
 File extension of operation behavior source file.
 

Detailed Description

Class that represents the name and the path of external files where Operation definitions are stored.

Definition at line 46 of file OperationModule.hh.

Constructor & Destructor Documentation

◆ OperationModule() [1/2]

OperationModule::OperationModule ( const std::string &  name,
const std::string &  path 
)

Constructor.

Parameters
nameThe name of the module.
pathThe path of the module.

Definition at line 54 of file OperationModule.cc.

56 : path_(path), name_(name) {
57}
std::string name_
The name of the module.
virtual std::string name() const
std::string path_
The path of the module.

◆ OperationModule() [2/2]

OperationModule::OperationModule ( const OperationModule om)

Copy constructor.

Parameters
omThe module to be copied.

Definition at line 64 of file OperationModule.cc.

64 {
65 name_ = om.name();
67}
static std::string directoryOfPath(const std::string fileName)
Definition FileSystem.cc:79
virtual std::string propertiesModule() const

References FileSystem::directoryOfPath(), name(), name_, path_, and propertiesModule().

Here is the call graph for this function:

◆ ~OperationModule()

OperationModule::~OperationModule ( )
virtual

Destructor.

Definition at line 72 of file OperationModule.cc.

72 {
73}

Member Function Documentation

◆ behaviorFileName()

std::string OperationModule::behaviorFileName ( ) const
private

Returns the name of the behavior file name.

Returns
The name of the behavior file name.

Definition at line 170 of file OperationModule.cc.

170 {
172}
static const std::string BEHAVIOR_FILE_EXTENSION
File extension of operation behavior file.

References BEHAVIOR_FILE_EXTENSION, and name_.

Referenced by behaviorModule(), and definesBehavior().

◆ behaviorModule()

string OperationModule::behaviorModule ( ) const
virtual

Returns the name of the behavior module.

Returns
The name of the behavior module.
Exceptions
FileNotFoundIf behavior module is not found.

Reimplemented in NullOperationModule.

Definition at line 105 of file OperationModule.cc.

105 {
106 if (!definesBehavior()) {
107 std::string method = "OperationModule::behaviorModule()";
108 std::string msg = "Behavior file not found: " + behaviorFileName();
109 throw FileNotFound(__FILE__, __LINE__, method, msg);
110 }
111
113}
static const std::string DIRECTORY_SEPARATOR
std::string behaviorFileName() const
virtual bool definesBehavior() const

References behaviorFileName(), definesBehavior(), FileSystem::DIRECTORY_SEPARATOR, and path_.

Here is the call graph for this function:

◆ behaviorSourceFileName()

std::string OperationModule::behaviorSourceFileName ( ) const
private

Returns the name of the code file.

Returns
The name of the code file.

Definition at line 190 of file OperationModule.cc.

190 {
192}
static const std::string BEHAVIOR_SOURCE_FILE_EXTENSION
File extension of operation behavior source file.

References BEHAVIOR_SOURCE_FILE_EXTENSION, and name_.

Referenced by behaviorSourceModule(), and hasBehaviorSource().

◆ behaviorSourceModule()

string OperationModule::behaviorSourceModule ( ) const
virtual

Returns the name of the behavior source code file.

Returns
The name of the behavior source code file.
Exceptions
FileNotFoundIf behavior source file not found.

Reimplemented in NullOperationModule.

Definition at line 144 of file OperationModule.cc.

144 {
145 if (!hasBehaviorSource()) {
146 std::string method = "OperationModule::behaviorSourceModule()";
147 std::string msg = "Behavior source file not found.";
148 throw FileNotFound(__FILE__, __LINE__, method, msg);
149 }
150
152}
virtual bool hasBehaviorSource() const
std::string behaviorSourceFileName() const

References behaviorSourceFileName(), FileSystem::DIRECTORY_SEPARATOR, hasBehaviorSource(), and path_.

Referenced by OperationPropertyDialog::onOpen().

Here is the call graph for this function:

◆ definesBehavior()

bool OperationModule::definesBehavior ( ) const
virtual

Checks whether OperationModule has behavior definition file.

Returns
True if OperationModule has behavior definition file.

Reimplemented in NullOperationModule.

Definition at line 93 of file OperationModule.cc.

93 {
96}
static bool fileExists(const std::string fileName)

References behaviorFileName(), FileSystem::DIRECTORY_SEPARATOR, FileSystem::fileExists(), and path_.

Referenced by behaviorModule().

Here is the call graph for this function:

◆ hasBehaviorSource()

bool OperationModule::hasBehaviorSource ( ) const
virtual

Checks whether module has behavior source file.

Returns
True if module has behavior source file.

Reimplemented in NullOperationModule.

Definition at line 131 of file OperationModule.cc.

References behaviorSourceFileName(), FileSystem::DIRECTORY_SEPARATOR, FileSystem::fileExists(), and path_.

Referenced by behaviorSourceModule(), OperationPropertyDialog::createContents(), OperationPropertyDialog::onOpen(), and OperationPropertyDialog::setBehaviorLabel().

Here is the call graph for this function:

◆ name()

std::string OperationModule::name ( ) const
virtual

Returns the name of the module.

Returns
The name of the module.

Reimplemented in NullOperationModule.

Definition at line 160 of file OperationModule.cc.

160 {
161 return name_;
162}

References name_.

Referenced by OSEdTreeView::constructTree(), OperationContainer::module(), OperationModule(), operator=(), and OperationPropertyDialog::updateOperation().

◆ operator=()

OperationModule & OperationModule::operator= ( const OperationModule om)

Assignment operator.

Parameters
omModule to be assigned.

Definition at line 81 of file OperationModule.cc.

81 {
82 name_ = om.name();
84 return *this;
85}

References FileSystem::directoryOfPath(), name(), name_, path_, and propertiesModule().

Here is the call graph for this function:

◆ propertiesModule()

string OperationModule::propertiesModule ( ) const
virtual

◆ propertyFileName()

std::string OperationModule::propertyFileName ( ) const
private

Returns the name of the properties file.

Returns
The name of the properties file.

Definition at line 180 of file OperationModule.cc.

180 {
182}
static const std::string PROPERTY_FILE_EXTENSION
File extension of operation property file.

References name_, and PROPERTY_FILE_EXTENSION.

Referenced by propertiesModule().

Member Data Documentation

◆ BEHAVIOR_FILE_EXTENSION

const string OperationModule::BEHAVIOR_FILE_EXTENSION = ".opb"
staticprivate

File extension of operation behavior file.

Behavior file extension.

Definition at line 70 of file OperationModule.hh.

Referenced by behaviorFileName().

◆ BEHAVIOR_SOURCE_FILE_EXTENSION

const string OperationModule::BEHAVIOR_SOURCE_FILE_EXTENSION = ".cc"
staticprivate

File extension of operation behavior source file.

Source file extension.

Definition at line 72 of file OperationModule.hh.

Referenced by behaviorSourceFileName().

◆ name_

std::string OperationModule::name_
private

The name of the module.

Definition at line 77 of file OperationModule.hh.

Referenced by behaviorFileName(), behaviorSourceFileName(), name(), OperationModule(), operator=(), and propertyFileName().

◆ path_

std::string OperationModule::path_
private

◆ PROPERTY_FILE_EXTENSION

const string OperationModule::PROPERTY_FILE_EXTENSION = ".opp"
staticprivate

File extension of operation property file.

Property file extension.

Definition at line 68 of file OperationModule.hh.

Referenced by propertyFileName().


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