OpenASIP 2.2
Loading...
Searching...
No Matches
OperationIndex.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 OperationIndex.hh
26 *
27 * Declaration of OperationIndex class.
28 *
29 * @author Jussi Nykänen 2004 (nykanen-no.spam-cs.tut.fi)
30 * @note rating: yellow
31 * @note reviewed 19 August 2004 by pj, jn, ao, ac
32 */
33
34#ifndef TTA_OPERATION_INDEX_HH
35#define TTA_OPERATION_INDEX_HH
36
37#include <map>
38#include <vector>
39#include <string>
40#include <set>
41
44#include "Exception.hh"
45
46class OperationModule;
47class ObjectState;
48class Operation;
49class TCEString;
51
52/**
53 * Class that holds information about search paths, modules and operations.
54 *
55 * An indexed table of all operations available organized by modules and
56 * indexed by names.
57 */
59public:
60
61 static const std::string PROPERTY_FILE_EXTENSION;
62
64 virtual ~OperationIndex();
65
66 void addPath(const std::string& path);
67 std::string path(int i) const;
68 int pathCount() const;
69
71 int moduleCount() const;
72 OperationModule& module(int i, const std::string& path);
73 int moduleCount(const std::string& path) const;
74 void addModule(OperationModule* module, const std::string& path);
75 void removeModule(const std::string& path, const std::string& modName);
76 void refreshModule(const std::string& path, const std::string& modName);
77
78 OperationModule& moduleOf(const std::string& name);
79 std::string operationName(int i, const OperationModule& om);
80 int operationCount(const OperationModule& om);
81
83
84private:
85 /// Contains all operation modules indexed by full path names.
86 typedef std::map<std::string, std::vector<OperationModule*> >
88 /// Contains all object state trees of modules indexed by operation
89 ///definition module names.
90 typedef std::map<std::string, ObjectState*> DefinitionTable;
91
92 /// Copying not allowed.
94 /// Assignment not allowed.
96
98
100 const std::string& path,
101 const std::string& operName);
102
103 /// List of paths searched for the operation modules.
104 std::vector<std::string> paths_;
105 /// Contains all operation modules found in a search path organized by path
106 /// names.
108 /// Contains all operation definitions defined in available operation
109 /// modules indexed by module names.
111 /// Container holding all modules.
112 std::vector<OperationModule*> modules_;
113 /// Reads the operation property definitions.
116 std::vector<OperationBehaviorProxy*> proxies_;
117 std::set<const OperationModule*> brokenModules_;
118};
119
120#include "OperationIndex.icc"
121
122#endif
std::map< std::string, ObjectState * > DefinitionTable
Contains all object state trees of modules indexed by operation definition module names.
OperationSerializer serializer_
Reads the operation property definitions.
void readOperations(const OperationModule &module)
static const std::string PROPERTY_FILE_EXTENSION
virtual ~OperationIndex()
ModuleTable modulesInPath_
Contains all operation modules found in a search path organized by path names.
DefinitionTable opDefinitions_
Contains all operation definitions defined in available operation modules indexed by module names.
std::string operationName(int i, const OperationModule &om)
OperationModule & module(int i)
Operation * effectiveOperation(const TCEString &name)
void removeModule(const std::string &path, const std::string &modName)
std::string path(int i) const
std::set< const OperationModule * > brokenModules_
OperationModule & moduleOf(const std::string &name)
std::vector< std::string > paths_
List of paths searched for the operation modules.
OperationIndex & operator=(const OperationIndex &)
Assignment not allowed.
void addModule(OperationModule *module, const std::string &path)
std::vector< OperationBehaviorProxy * > proxies_
void addPath(const std::string &path)
int operationCount(const OperationModule &om)
OperationBehaviorLoader loader_
OperationIndex(const OperationIndex &)
Copying not allowed.
std::map< std::string, std::vector< OperationModule * > > ModuleTable
Contains all operation modules indexed by full path names.
int pathCount() const
int moduleCount() const
void refreshModule(const std::string &path, const std::string &modName)
std::vector< OperationModule * > modules_
Container holding all modules.