blob: 5735e109f0c754b8c61b79f26c1847188cfd3dd0 (
plain)
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
|
// $Id$
//
#include "DomainDataManager.h"
#include "ResourceCommitmentManager.h"
// Implementation skeleton constructor
CIAO::ResourceCommitmentManager_i::ResourceCommitmentManager_i (void)
{
}
// Implementation skeleton destructor
CIAO::ResourceCommitmentManager_i::~ResourceCommitmentManager_i (void)
{
}
void CIAO::ResourceCommitmentManager_i::commitResources (
const ::Deployment::ResourceAllocations& resources)
{
CIAO::DomainDataManager::get_data_manager ()->commitResourceAllocation (resources);
// commit succesful .. add to commited resource
this->add_to_commited_resource (resources);
return;
}
void CIAO::ResourceCommitmentManager_i::releaseResources (
const ::Deployment::ResourceAllocations & resources)
{
::Deployment::ResourceAllocations res;
// if the resources set is null , use the already allocated resources ..
if (resources.length () == 0)
res = this->resources_;
else
res = resources;
CIAO::DomainDataManager::get_data_manager ()->releaseResourceAllocation (res);
return;
}
int CIAO::ResourceCommitmentManager_i::add_to_commited_resource (
::Deployment::ResourceAllocations res)
{
CORBA::ULong current_length = this->resources_.length ();
this->resources_.length (current_length + res.length ());
for (CORBA::ULong i =0;i < res.length ();i++)
this->resources_[current_length + i] = res[i];
return 0;
}
|