Statistics
| Branch: | Tag: | Revision:

one / src / scheduler / include / HostPoolXML.h @ 4697f1ee

History | View | Annotate | Download (2 KB)

1
/* -------------------------------------------------------------------------- */
2
/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems                */
3
/*                                                                            */
4
/* Licensed under the Apache License, Version 2.0 (the "License"); you may    */
5
/* not use this file except in compliance with the License. You may obtain    */
6
/* a copy of the License at                                                   */
7
/*                                                                            */
8
/* http://www.apache.org/licenses/LICENSE-2.0                                 */
9
/*                                                                            */
10
/* Unless required by applicable law or agreed to in writing, software        */
11
/* distributed under the License is distributed on an "AS IS" BASIS,          */
12
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   */
13
/* See the License for the specific language governing permissions and        */
14
/* limitations under the License.                                             */
15
/* -------------------------------------------------------------------------- */
16

    
17

    
18
#ifndef HOST_POOL_XML_H_
19
#define HOST_POOL_XML_H_
20

    
21
#include "PoolXML.h"
22
#include "HostXML.h"
23
#include "ClusterPoolXML.h"
24

    
25
using namespace std;
26

    
27
class HostPoolXML : public PoolXML
28
{
29
public:
30

    
31
    HostPoolXML(Client* client):PoolXML(client) {};
32

    
33
    ~HostPoolXML(){};
34

    
35
    int set_up();
36

    
37
    /**
38
     *  Gets an object from the pool
39
     *   @param oid the object unique identifier
40
     *
41
     *   @return a pointer to the object, 0 in case of failure
42
     */
43
    HostXML * get(int oid) const
44
    {
45
        return static_cast<HostXML *>(PoolXML::get(oid));
46
    };
47

    
48
protected:
49

    
50
    int get_suitable_nodes(vector<xmlNodePtr>& content)
51
    {
52
        return get_nodes("/HOST_POOL/HOST[STATE=1 or STATE=2]", content);
53
    };
54

    
55
    void add_object(xmlNodePtr node);
56

    
57
    int load_info(xmlrpc_c::value &result);
58
};
59

    
60
#endif /* HOST_POOL_XML_H_ */