summaryrefslogtreecommitdiff
path: root/DAnCE/TargetManager/ResourceCommitmentManager.h
blob: c29dea0c59f5f75c6b7a68aaf4eb74e99e974e0c (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
53
54
55
56
57
58
59
60
61
//$Id$
//
#ifndef DEPLOYMENT_RESOURCECOMMITMENTMANAGERI_H_
#define DEPLOYMENT_RESOURCECOMMITMENTMANAGERI_H_

#include "Deployment_ResourceCommitmentManagerS.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

namespace CIAO {

  class  ResourceCommitmentManager_i
   : public virtual POA_Deployment::ResourceCommitmentManager
    {
      public:
        // Constructor
        ResourceCommitmentManager_i (void);

        // Destructor
        virtual ~ResourceCommitmentManager_i (void);

        /**
         * @function commitResources
         * @brief Commits the resources 
         *
         * @description This function makes a call to the DomainDataManager in order
         * to commit the resources mentioned in the ResourceAllocation 
         * sequence. If the resource cannot be allocated throws a 
         * ResourceCommitmentFailed exception
         */
        virtual
          void commitResources (
              const ::Deployment::ResourceAllocations& resources
              )
          ACE_THROW_SPEC ((::CORBA::SystemException,
                ::Deployment::ResourceCommitmentFailure));

        virtual
          void releaseResources (
              const ::Deployment::ResourceAllocations & resources
              )
          ACE_THROW_SPEC ((::CORBA::SystemException,
                ::Deployment::ResourceCommitmentFailure));

      private:
        /**
         * @function add_to_commited_resource
         * @brief This function adds the res to already commited resources. 
         *        This is to be called from within commitResources
         */
        int add_to_commited_resource (::Deployment::ResourceAllocations res);

        /// The commited resource
        ::Deployment::ResourceAllocations resources_;
    };

};

#endif /* DEPLOYMENT_RESOURCECOMMITMENTMANAGERI_H_  */