~scarneiro/ubuntu/oneiric/opendrim-lmp-recordlog/fix-for-756108

« back to all changes in this revision

Viewing changes to OpenDRIM_RecordLogCapabilities/cmpiOpenDRIM_RecordLogCapabilities.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Guillaume BOTTEX
  • Date: 2009-08-19 17:08:36 UTC
  • Revision ID: james.westby@ubuntu.com-20090819170836-4pdxix40ulw5xqds
Tags: upstream-1.1.1
ImportĀ upstreamĀ versionĀ 1.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*###############################################################################
 
2
# Linux Management Providers (LMP), OpenDRIM_RecordLogPackage provider package
 
3
# Copyright (C) 2007 Ilsoo Byun, ETRI <widepis@etri.re.kr, widepis@empal.com>
 
4
 
5
# This program is being developed under the "OpenDRIM" project.
 
6
# The "OpenDRIM" project web page: http://opendrim.sourceforge.net
 
7
# The "OpenDRIM" project mailing list: opendrim@googlegroups.com
 
8
 
9
# This program is free software; you can redistribute it and/or
 
10
# modify it under the terms of the GNU General Public License
 
11
# as published by the Free Software Foundation; version 2
 
12
# of the License.
 
13
 
14
# This program is distributed in the hope that it will be useful,
 
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
# GNU General Public License for more details.
 
18
 
19
# You should have received a copy of the GNU General Public License
 
20
# along with this program; if not, write to the Free Software
 
21
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
22
#################################################################################
 
23
 
 
24
#################################################################################
 
25
# To contributors, please leave your contact information in this section
 
26
# AND comment your changes in the source code.
 
27
 
28
# Modified by 2008 Guillaume BOTTEX, ETRI <guillaumebottex@etri.re.kr, guillaumebottex@gmail.com>
 
29
###############################################################################*/
 
30
 
 
31
#include "cmpiOpenDRIM_RecordLogCapabilities.h"
 
32
 
 
33
CMPIObjectPath* OpenDRIM_RecordLogPackage_OpenDRIM_RecordLogCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RecordLogCapabilities& instance) {
 
34
        _E_;
 
35
        Objectpath op(broker, OpenDRIM_RecordLogCapabilities_classnames[0], OpenDRIM_RecordLogCapabilities_NAMESPACE);
 
36
 
 
37
        if (!instance.InstanceID_isNULL)
 
38
                op.addKey("InstanceID", instance.InstanceID);
 
39
 
 
40
        _L_;
 
41
        return op.getHdl();
 
42
}
 
43
 
 
44
CMPIInstance* OpenDRIM_RecordLogPackage_OpenDRIM_RecordLogCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RecordLogCapabilities& instance) {
 
45
        _E_;
 
46
        Objectpath op(broker, OpenDRIM_RecordLogPackage_OpenDRIM_RecordLogCapabilities_toCMPIObjectPath(broker, instance));
 
47
        Instance ci(broker, op);
 
48
 
 
49
        if (!instance.Caption_isNULL)
 
50
                ci.setProperty("Caption", instance.Caption);
 
51
 
 
52
        if (!instance.Description_isNULL)
 
53
                ci.setProperty("Description", instance.Description);
 
54
 
 
55
        if (!instance.ElementName_isNULL)
 
56
                ci.setProperty("ElementName", instance.ElementName);
 
57
 
 
58
        if (!instance.ElementNameEditSupported_isNULL)
 
59
                ci.setProperty("ElementNameEditSupported", instance.ElementNameEditSupported);
 
60
 
 
61
        if (!instance.MaxElementNameLen_isNULL)
 
62
                ci.setProperty("MaxElementNameLen", instance.MaxElementNameLen);
 
63
 
 
64
        if (!instance.RequestedStatesSupported_isNULL)
 
65
                ci.setProperty("RequestedStatesSupported", instance.RequestedStatesSupported);
 
66
 
 
67
        if (!instance.ElementNameMask_isNULL)
 
68
                ci.setProperty("ElementNameMask", instance.ElementNameMask);
 
69
 
 
70
        if (!instance.StateAwareness_isNULL)
 
71
                ci.setProperty("StateAwareness", instance.StateAwareness);
 
72
 
 
73
        _L_;
 
74
        return ci.getHdl();
 
75
}
 
76
 
 
77
void OpenDRIM_RecordLogPackage_OpenDRIM_RecordLogCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RecordLogCapabilities& instance) {
 
78
        _E_;
 
79
        Objectpath op(broker, (CMPIObjectPath*) ref);
 
80
 
 
81
        if (op.getKey("InstanceID", instance.InstanceID) == OK)
 
82
                instance.InstanceID_isNULL = false;
 
83
 
 
84
        _L_;
 
85
}
 
86
 
 
87
void OpenDRIM_RecordLogPackage_OpenDRIM_RecordLogCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RecordLogCapabilities& instance) {
 
88
        _E_;
 
89
        Instance inst(broker, (CMPIInstance*) ci);
 
90
 
 
91
        if (inst.getProperty("Caption", instance.Caption) == OK)
 
92
                instance.Caption_isNULL = false;
 
93
 
 
94
        if (inst.getProperty("Description", instance.Description) == OK)
 
95
                instance.Description_isNULL = false;
 
96
 
 
97
        if (inst.getProperty("InstanceID", instance.InstanceID) == OK)
 
98
                instance.InstanceID_isNULL = false;
 
99
 
 
100
        if (inst.getProperty("ElementName", instance.ElementName) == OK)
 
101
                instance.ElementName_isNULL = false;
 
102
 
 
103
        if (inst.getProperty("ElementNameEditSupported", instance.ElementNameEditSupported) == OK)
 
104
                instance.ElementNameEditSupported_isNULL = false;
 
105
 
 
106
        if (inst.getProperty("MaxElementNameLen", instance.MaxElementNameLen) == OK)
 
107
                instance.MaxElementNameLen_isNULL = false;
 
108
 
 
109
        if (inst.getProperty("RequestedStatesSupported", instance.RequestedStatesSupported) == OK)
 
110
                instance.RequestedStatesSupported_isNULL = false;
 
111
 
 
112
        if (inst.getProperty("ElementNameMask", instance.ElementNameMask) == OK)
 
113
                instance.ElementNameMask_isNULL = false;
 
114
 
 
115
        if (inst.getProperty("StateAwareness", instance.StateAwareness) == OK)
 
116
                instance.StateAwareness_isNULL = false;
 
117
 
 
118
        _L_;
 
119
}
 
120
 
 
121
void OpenDRIM_RecordLogPackage_OpenDRIM_RecordLogCapabilities_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_RecordLogCapabilities_CreateGoalSettings_In& args) {
 
122
        _E_;
 
123
        CMPIStatus rc;
 
124
        CMPIData data;
 
125
 
 
126
        vector<string> TemplateGoalSettings;
 
127
        data = in->ft->getArg(in, "TemplateGoalSettings", &rc);
 
128
        if (rc.rc == OK) {
 
129
                CT_ToC(data, TemplateGoalSettings);     
 
130
                args.setTemplateGoalSettings(TemplateGoalSettings);
 
131
        }                       
 
132
 
 
133
        vector<string> SupportedGoalSettings;
 
134
        data = in->ft->getArg(in, "SupportedGoalSettings", &rc);
 
135
        if (rc.rc == OK) {
 
136
                CT_ToC(data, SupportedGoalSettings);    
 
137
                args.setSupportedGoalSettings(SupportedGoalSettings);
 
138
        }                       
 
139
 
 
140
        _L_;
 
141
}
 
142
 
 
143
void OpenDRIM_RecordLogPackage_OpenDRIM_RecordLogCapabilities_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_RecordLogCapabilities_CreateGoalSettings_Out& args) {
 
144
        _E_;
 
145
        CMPIValue value;
 
146
        int errorMessage;
 
147
 
 
148
        vector<string> SupportedGoalSettings;
 
149
        errorMessage = args.getSupportedGoalSettings(SupportedGoalSettings);
 
150
        if (errorMessage == OK) {
 
151
                value = CT_toCMPI(broker, SupportedGoalSettings);
 
152
                out->ft->addArg(out, "SupportedGoalSettings", &value, CMPI_stringA);
 
153
        }
 
154
 
 
155
        _L_;
 
156
}