OpenASIP  2.0
OperationModule.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file OperationModule.hh
26  *
27  * Declaration of OperationModule class.
28  *
29  * @author Jussi Nykänen 2004 (nykanen-no.spam-cs.tut.fi)
30  * @note rating: yellow
31  * @note reviewed 7 September 2004 by pj, jn, jm, ao
32  */
33 
34 #ifndef TTA_OPERATION_MODULE_HH
35 #define TTA_OPERATION_MODULE_HH
36 
37 #include <string>
38 
39 #include "Exception.hh"
40 #include "FileSystem.hh"
41 
42 /**
43  * Class that represents the name and the path of external files where
44  * Operation definitions are stored.
45  */
47 public:
48 
49  OperationModule(const std::string& name, const std::string& path);
51  virtual ~OperationModule();
52 
54 
55  virtual std::string name() const;
56  virtual bool definesBehavior() const;
57  virtual std::string behaviorModule() const;
58  virtual std::string propertiesModule() const;
59  virtual bool hasBehaviorSource() const;
60  virtual std::string behaviorSourceModule() const;
61 
62 private:
63  std::string propertyFileName() const;
64  std::string behaviorFileName() const;
65  std::string behaviorSourceFileName() const;
66 
67  /// File extension of operation property file.
68  static const std::string PROPERTY_FILE_EXTENSION;
69  /// File extension of operation behavior file.
70  static const std::string BEHAVIOR_FILE_EXTENSION;
71  /// File extension of operation behavior source file.
72  static const std::string BEHAVIOR_SOURCE_FILE_EXTENSION;
73 
74  /// The path of the module.
75  std::string path_;
76  /// The name of the module.
77  std::string name_;
78 };
79 
80 //////////////////////////////////////////////////////////////////////////////
81 // NullOperationModule
82 //////////////////////////////////////////////////////////////////////////////
83 
84 /**
85  * Singleton class that is used to represent a null value for operation state.
86  *
87  */
89 public:
90 
91  static NullOperationModule& instance();
92 
93  virtual ~NullOperationModule();
94 
95  virtual std::string name() const;
96  virtual bool definesBehavior() const;
97  virtual std::string behaviorModule() const;
98  virtual std::string propertiesModule() const;
99  virtual bool hasBehaviorSource() const;
100  virtual std::string behaviorSourceModule() const;
101 
102 private:
106 
107  /// Unique instance of NullOperationModule.
109 };
110 
111 #include "OperationModule.icc"
112 
113 #endif
NullOperationModule::~NullOperationModule
virtual ~NullOperationModule()
Definition: OperationModule.cc:209
OperationModule::definesBehavior
virtual bool definesBehavior() const
Definition: OperationModule.cc:93
FileSystem.hh
NullOperationModule::name
virtual std::string name() const
Definition: OperationModule.cc:218
OperationModule::~OperationModule
virtual ~OperationModule()
Definition: OperationModule.cc:72
NullOperationModule::behaviorModule
virtual std::string behaviorModule() const
Definition: OperationModule.cc:241
Exception.hh
NullOperationModule::definesBehavior
virtual bool definesBehavior() const
Definition: OperationModule.cc:229
OperationModule::OperationModule
OperationModule(const std::string &name, const std::string &path)
Definition: OperationModule.cc:54
OperationModule::behaviorModule
virtual std::string behaviorModule() const
Definition: OperationModule.cc:105
NullOperationModule::propertiesModule
virtual std::string propertiesModule() const
Definition: OperationModule.cc:252
OperationModule.icc
OperationModule::path_
std::string path_
The path of the module.
Definition: OperationModule.hh:75
OperationModule::name_
std::string name_
The name of the module.
Definition: OperationModule.hh:77
NullOperationModule::NullOperationModule
NullOperationModule()
Definition: OperationModule.cc:203
OperationModule::propertiesModule
virtual std::string propertiesModule() const
Definition: OperationModule.cc:121
OperationModule::behaviorSourceModule
virtual std::string behaviorSourceModule() const
Definition: OperationModule.cc:144
OperationModule::BEHAVIOR_SOURCE_FILE_EXTENSION
static const std::string BEHAVIOR_SOURCE_FILE_EXTENSION
File extension of operation behavior source file.
Definition: OperationModule.hh:72
NullOperationModule::instance_
static NullOperationModule instance_
Unique instance of NullOperationModule.
Definition: OperationModule.hh:108
NullOperationModule::operator=
NullOperationModule & operator=(const NullOperationModule &om)
NullOperationModule::behaviorSourceModule
virtual std::string behaviorSourceModule() const
Definition: OperationModule.cc:276
OperationModule
Definition: OperationModule.hh:46
OperationModule::hasBehaviorSource
virtual bool hasBehaviorSource() const
Definition: OperationModule.cc:131
OperationModule::operator=
OperationModule & operator=(const OperationModule &om)
Definition: OperationModule.cc:81
OperationModule::BEHAVIOR_FILE_EXTENSION
static const std::string BEHAVIOR_FILE_EXTENSION
File extension of operation behavior file.
Definition: OperationModule.hh:70
NullOperationModule::hasBehaviorSource
virtual bool hasBehaviorSource() const
Definition: OperationModule.cc:264
OperationModule::PROPERTY_FILE_EXTENSION
static const std::string PROPERTY_FILE_EXTENSION
File extension of operation property file.
Definition: OperationModule.hh:68
NullOperationModule
Definition: OperationModule.hh:88
OperationModule::behaviorSourceFileName
std::string behaviorSourceFileName() const
Definition: OperationModule.cc:190
OperationModule::name
virtual std::string name() const
Definition: OperationModule.cc:160
NullOperationModule::instance
static NullOperationModule & instance()
OperationModule::behaviorFileName
std::string behaviorFileName() const
Definition: OperationModule.cc:170
OperationModule::propertyFileName
std::string propertyFileName() const
Definition: OperationModule.cc:180