(file) Return to CMPI_SubCond.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ProviderManager2 / CMPI

 1 karl  1.7 //%2004////////////////////////////////////////////////////////////////////////
 2 schuur 1.1 //
 3 karl   1.7 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 4            // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
 5            // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
 6 schuur 1.1 // IBM Corp.; EMC Corporation, The Open Group.
 7 karl   1.7 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
 8            // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
 9 schuur 1.1 //
10            // Permission is hereby granted, free of charge, to any person obtaining a copy
11            // of this software and associated documentation files (the "Software"), to
12            // deal in the Software without restriction, including without limitation the
13            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
14            // sell copies of the Software, and to permit persons to whom the Software is
15            // furnished to do so, subject to the following conditions:
16 karl   1.7 // 
17 schuur 1.1 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
18            // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
19            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
20            // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
21            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23            // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25            //
26            //==============================================================================
27            //
28            // Author:      Adrian Schuur, schuur@de.ibm.com
29            //
30            // Modified By:
31            //
32            //%/////////////////////////////////////////////////////////////////////////////
33            
34 schuur 1.4 #include "CMPI_Version.h"
35 schuur 1.2 
36 schuur 1.1 #include "CMPI_SubCond.h"
37            #include "CMPI_Ftabs.h"
38            #include "CMPI_Value.h"
39            #include "CMPI_String.h"
40            
41            PEGASUS_USING_STD;
42            PEGASUS_NAMESPACE_BEGIN
43            
44 schuur 1.6 extern "C" {
45            
46               CMPIStatus sbcRelease(CMPISubCond* sc) {
47                  CMReturn(CMPI_RC_OK);
48               }
49            
50               CMPISubCond* sbcClone(CMPISubCond* eSc, CMPIStatus* rc) {
51                     if (rc) CMSetStatus(rc,CMPI_RC_ERR_NOT_SUPPORTED);
52                     return NULL;
53               }
54            
55               CMPICount sbcGetCount(CMPISubCond* eSbc, CMPIStatus* rc) {
56                  CMPI_SubCond *sbc=(CMPI_SubCond*)eSbc;
57                  if (rc) CMSetStatus(rc,CMPI_RC_OK);
58                  return sbc->row->size();
59               }
60            
61               CMPIPredicate* sbcGetPredicateAt(CMPISubCond* eSbc, unsigned int index, CMPIStatus* rc) {
62                  CMPI_SubCond *sbc=(CMPI_SubCond*)eSbc;
63                  if (index<=sbc->row->size()) {
64 marek  1.8          const term_el *term=(sbc->row->getData())+index;
65 schuur 1.6 
66                     CMPIPredicate *prd=(CMPIPredicate*)new CMPI_Predicate(term);
67                     if (rc) CMSetStatus(rc,CMPI_RC_OK);
68                     return prd;
69                  }   
70                  if (rc) CMSetStatus(rc,CMPI_RC_ERR_FAILED);
71                  return NULL; 
72               }
73 schuur 1.1 
74 schuur 1.6    CMPIPredicate* sbcGetPredicate(CMPISubCond* eSbc, const char *name, CMPIStatus* rc) {
75                  CMPI_SubCond *sc=(CMPI_SubCond*)eSbc;
76 schuur 1.1       return NULL;
77 schuur 1.6    }
78 schuur 1.1 
79            }
80            
81 schuur 1.6 static CMPISubCondFT scnd_FT={
82 schuur 1.1      CMPICurrentVersion,
83                 sbcRelease,
84                 sbcClone,
85                 sbcGetCount,
86                 sbcGetPredicateAt,
87                 sbcGetPredicate
88             };
89            
90            CMPISubCondFT *CMPI_SubCond_Ftab=&scnd_FT;
91            
92            CMPI_SubCond::CMPI_SubCond(const TableauRow* tblor)
93              : row(tblor) {
94               ft=CMPI_SubCond_Ftab;
95            }
96            
97            
98            PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2