- Adjusted copy construction of the Dynamic* hierarchy. Hope this is what you wanted, Matteo...

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@751 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
elvez 2006-07-11 14:20:30 +00:00
parent b6b303c4e3
commit 8ffd81b823
7 changed files with 76 additions and 20 deletions

View file

@ -30,27 +30,28 @@
using namespace sgpem;
using namespace std;
DynamicProcess::DynamicProcess(StaticProcess* core)
: DynamicSchedulable(), _core(core)
{}
DynamicProcess::DynamicProcess(StaticProcess* core) :
DynamicSchedulable(), _core(core)
{
assert(core != NULL);
}
DynamicProcess::DynamicProcess(const DynamicProcess &other) :
Schedulable(), DynamicSchedulable(other), Process()
Schedulable(), DynamicSchedulable(other), Process()
{
typedef vector<DynamicThread*>::const_iterator ThreadIt;
const vector<DynamicThread*>& other_threads = other._dynamic_threads;
for(ThreadIt it = other_threads.begin(); it != other_threads.end(); ++it)
_dynamic_threads.push_back(new DynamicThread(*(*it)));
new DynamicThread(*(*it), this);
}
DynamicProcess::~DynamicProcess()
{
for_each(_dynamic_threads.begin(), _dynamic_threads.end(), ptr_fun(operator delete));
for_each(_dynamic_threads.begin(), _dynamic_threads.end(), ptr_fun(operator delete));
}
std::vector<Thread*>
DynamicProcess::get_threads()
{