OpenASIP 2.2
Loading...
Searching...
No Matches
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 */
47public:
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
62private:
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 */
89public:
90
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
102private:
106
107 /// Unique instance of NullOperationModule.
109};
110
111#include "OperationModule.icc"
112
113#endif
NullOperationModule(const NullOperationModule &om)
virtual std::string propertiesModule() const
virtual bool definesBehavior() const
NullOperationModule & operator=(const NullOperationModule &om)
virtual std::string behaviorSourceModule() const
virtual bool hasBehaviorSource() const
static NullOperationModule instance_
Unique instance of NullOperationModule.
virtual std::string name() const
static NullOperationModule & instance()
virtual std::string behaviorModule() const
std::string name_
The name of the module.
virtual bool hasBehaviorSource() const
virtual std::string name() const
std::string behaviorSourceFileName() const
std::string behaviorFileName() const
virtual std::string behaviorSourceModule() const
static const std::string BEHAVIOR_FILE_EXTENSION
File extension of operation behavior file.
std::string path_
The path of the module.
std::string propertyFileName() const
static const std::string PROPERTY_FILE_EXTENSION
File extension of operation property file.
virtual bool definesBehavior() const
virtual std::string propertiesModule() const
static const std::string BEHAVIOR_SOURCE_FILE_EXTENSION
File extension of operation behavior source file.
OperationModule & operator=(const OperationModule &om)
virtual ~OperationModule()
virtual std::string behaviorModule() const