diff options
author | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2007-03-18 22:23:37 +0000 |
---|---|---|
committer | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2007-03-18 22:23:37 +0000 |
commit | 06a34455bd98b1379cc69bbc5b2cf085e0fc0d9b (patch) | |
tree | 8815ce3b3a85c3c4285429295f338e00ea4497f4 /CIAO/DAnCE/TargetManager/ResourceCommitmentManager.cpp | |
parent | d66fcc9b4aaec8e88eeb83fc578fdf8a3cc963de (diff) | |
download | ATCD-Static_RT_DAnCE.tar.gz |
Diffstat (limited to 'CIAO/DAnCE/TargetManager/ResourceCommitmentManager.cpp')
-rw-r--r-- | CIAO/DAnCE/TargetManager/ResourceCommitmentManager.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/CIAO/DAnCE/TargetManager/ResourceCommitmentManager.cpp b/CIAO/DAnCE/TargetManager/ResourceCommitmentManager.cpp new file mode 100644 index 00000000000..5735e109f0c --- /dev/null +++ b/CIAO/DAnCE/TargetManager/ResourceCommitmentManager.cpp @@ -0,0 +1,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; +} |