-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoupled.h
92 lines (67 loc) · 2.05 KB
/
coupled.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*******************************************************************
*
* DESCRIPTION: class Coupled
*
* AUTHOR: Amir Barylko & Jorge Beyoglonian
* Version 2: Daniel Rodriguez
* Version 3: Alejandro Troccoli
*
* EMAIL: mailto://[email protected]
* mailto://[email protected]
* mailto://[email protected]
* mailto://[email protected]
*
* DATE: 27/6/1998
* DATE: 27/2/1999 (v2)
* DATE: 4/10/2000 (v3)
*
*******************************************************************/
#ifndef __COUPLED_H
#define __COUPLED_H
/** include files **/
#include <list> // Template std::list
#include "model.h" // Base class Model
/** foward declarations **/
class SingleModelAdmin;
class ParallelMainSimulator ;
#define COUPLED_NAME "Coupled"
/** definitions **/
class Coupled : public Model
{
public:
Model &addModel( Model & );
//ModelList as std::list<ModelId> is used by the StandAlone version of NCD++
typedef std::list<ModelId> ModelList;
const ModelList &children() const
{return childs;}
//For the parallel version, PModelList will be defined
typedef std::list< Model *> PModelList;
const PModelList &childModels() const
{return pchilds;}
enum Type
{
cell,
regular
} ;
virtual Type type() const
{return regular;}
virtual std::string className() const
{return COUPLED_NAME;}
unsigned long totalProcCount() const;
unsigned long localProcCount() const;
protected:
friend class SingleParallelModelAdmin ;
friend class ParallelModelAdmin ;
friend class ParallelMainSimulator ;
Coupled( const std::string &name = "Coupled" ) // Default constructor
: Model( name )
{}
Coupled( const Coupled & ) ; // Copy constructor
virtual Model &addInfluence( const std::string &sourceName, const std::string &sourcePort, const std::string &destName, const std::string &destPort) ;
virtual ParallelProcessor &createParallelProcessor()
{ return SingleParallelProcessorAdmin::Instance().generateProcessor(this, localProc());}
private:
ModelList childs ;
PModelList pchilds;
} ; // class Coupled
#endif //__COUPLED_H