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