OpenASIP 2.2
Loading...
Searching...
No Matches
OperationBehaviorLoader.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 OperationBehaviorLoader.hh
26 *
27 * Declaration of OperationBehaviorLoader 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_BEHAVIOR_LOADER_HH
35#define TTA_OPERATION_BEHAVIOR_LOADER_HH
36
37#include <string>
38#include <map>
39
40#include "PluginTools.hh"
41
42class OperationIndex;
44class Operation;
45
46/**
47 * The purpose of this class is to import operation behavior models
48 * from dynamic modules.
49 *
50 * PluginTools is used to import the operation behavior modules.
51 * OperationIndex is used to obtain modules in which certain operation
52 * belongs to.
53 */
55public:
58
60
61 void freeBehavior();
62
63private:
64 /// Contains operation behavior models indexed by operation names.
65 typedef std::map<std::string, OperationBehavior*> BehaviorMap;
66 /// Contains all deletion function of operation behavior models.
67 typedef std::map<OperationBehavior*, void (*)(OperationBehavior*)>
69
70 /// Copying not allowed.
72 /// Assignment not allowed.
74
75 /// The name of the creation function in dynamic module.
76 static const std::string CREATE_FUNC;
77 /// The name of the deletion function in dynamic module.
78 static const std::string DELETE_FUNC;
79
80 /// Indexed table of all modules and operations accessible for this loader.
82 /// PluginTools for loading dynamic modules.
84 /// Container of all loaded operation behavior models.
86 /// Container of all destruction functions of behavioral models.
88};
89
90#endif
std::map< std::string, OperationBehavior * > BehaviorMap
Contains operation behavior models indexed by operation names.
static const std::string CREATE_FUNC
The name of the creation function in dynamic module.
DestructionMap destructors_
Container of all destruction functions of behavioral models.
BehaviorMap behaviors_
Container of all loaded operation behavior models.
static const std::string DELETE_FUNC
The name of the deletion function in dynamic module.
OperationBehavior & importBehavior(const Operation &parent)
PluginTools tools_
PluginTools for loading dynamic modules.
OperationIndex & index_
Indexed table of all modules and operations accessible for this loader.
OperationBehaviorLoader(const OperationBehaviorLoader &)
Copying not allowed.
OperationBehaviorLoader & operator=(const OperationBehaviorLoader &)
Assignment not allowed.
std::map< OperationBehavior *, void(*)(OperationBehavior *)> DestructionMap
Contains all deletion function of operation behavior models.