1 karl 1.4 //%2005////////////////////////////////////////////////////////////////////////
|
2 chuck 1.2 //
|
3 karl 1.4 // 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 chuck 1.2 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.4 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
9 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 chuck 1.2 //
12 // Permission is hereby granted, free of charge, to any person obtaining a copy
13 // of this software and associated documentation files (the "Software"), to
14 // deal in the Software without restriction, including without limitation the
15 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
16 // sell copies of the Software, and to permit persons to whom the Software is
17 // furnished to do so, subject to the following conditions:
18 //
19 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
20 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
21 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
22 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
23 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
25 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28 //==============================================================================
29 //
30 // Authors: David Rosckes (rosckes@us.ibm.com)
31 // Bert Rivero (hurivero@us.ibm.com)
32 chuck 1.2 // Chuck Carmack (carmack@us.ibm.com)
33 // Brian Lucier (lucier@us.ibm.com)
34 //
|
35 aruran.ms 1.6 // Modified By: Aruran, IBM(ashanmug@in.ibm.com) for Bug# 3588
|
36 chuck 1.2 //
37 //%/////////////////////////////////////////////////////////////////////////////
38
39 #include "CQLChainedIdentifier.h"
40 #include "CQLChainedIdentifierRep.h"
41 #include <Pegasus/CQL/CQLFactory.h>
42 PEGASUS_NAMESPACE_BEGIN
43
44 /*
45 #define PEGASUS_ARRAY_T CQLChainedIdentifier
46 #include <Pegasus/Common/ArrayImpl.h>
47 #undef PEGASUS_ARRAY_T
48 */
49
50 CQLChainedIdentifier::CQLChainedIdentifier():
|
51 humberto 1.3 QueryChainedIdentifier()
|
52 chuck 1.2 {
|
53 humberto 1.3 if(_rep)
54 delete _rep;
55 _rep = NULL;
|
56 chuck 1.2 _rep = new CQLChainedIdentifierRep();
57 }
58
|
59 aruran.ms 1.6 CQLChainedIdentifier::CQLChainedIdentifier(const String& inString):
|
60 humberto 1.3 QueryChainedIdentifier()
|
61 chuck 1.2 {
|
62 humberto 1.3 if(_rep)
63 delete _rep;
64 _rep = NULL;
|
65 chuck 1.2 _rep = new CQLChainedIdentifierRep(inString);
66 }
67
68 CQLChainedIdentifier::CQLChainedIdentifier(const CQLIdentifier &id):
|
69 humberto 1.3 QueryChainedIdentifier()
|
70 chuck 1.2 {
|
71 humberto 1.3 if(_rep)
72 delete _rep;
73 _rep = NULL;
74 _rep = new CQLChainedIdentifierRep(id);
|
75 chuck 1.2 }
76
77 CQLChainedIdentifier::CQLChainedIdentifier(const CQLChainedIdentifier& cid):
|
78 humberto 1.3 QueryChainedIdentifier()
|
79 chuck 1.2 {
|
80 humberto 1.3 if(_rep)
81 delete _rep;
82 _rep = NULL;
83 _rep = new QueryChainedIdentifierRep(cid._rep);
|
84 chuck 1.2 }
85
86 CQLChainedIdentifier::~CQLChainedIdentifier()
87 {
88 if(_rep)
89 delete _rep;
90 _rep = NULL;
91 }
92
93 Array<CQLIdentifier> CQLChainedIdentifier::getSubIdentifiers()const
94 {
95 Array<CQLIdentifier> result;
96 Array<QueryIdentifier> qIds = _rep->getSubIdentifiers();
97 for (Uint32 i = 0; i < qIds.size(); i++)
98 {
99 CQLIdentifier cid(qIds[i]);
100 result.append(cid);
101 }
102
103 return result;
104 }
105 chuck 1.2
106 CQLIdentifier CQLChainedIdentifier::getLastIdentifier()const{
107 QueryIdentifier qid = _rep->getLastIdentifier();
108 return CQLIdentifier(qid);
109 }
110
111 CQLIdentifier CQLChainedIdentifier::operator[](Uint32 index)const
112 {
113 QueryIdentifier qid = _rep->operator[](index);
114 return CQLIdentifier(qid);
115 }
116
117 CQLChainedIdentifier& CQLChainedIdentifier::operator=(const CQLChainedIdentifier& rhs)
118 {
119 if(&rhs != this)
120 {
121 if(_rep) delete _rep;
122 _rep = new QueryChainedIdentifierRep(rhs._rep);
123 }
124 return *this;
125 }
126 chuck 1.2
127 PEGASUS_NAMESPACE_END
|