(file) Return to CQLChainedIdentifier.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / CQL

  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           // Authors: David Rosckes (rosckes@us.ibm.com)
 33           //          Bert Rivero (hurivero@us.ibm.com)
 34 chuck 1.2 //          Chuck Carmack (carmack@us.ibm.com)
 35           //          Brian Lucier (lucier@us.ibm.com)
 36           //
 37 aruran.ms 1.6 // Modified By: Aruran, IBM(ashanmug@in.ibm.com) for Bug# 3588
 38 chuck     1.2 //
 39               //%/////////////////////////////////////////////////////////////////////////////
 40               
 41               #include "CQLChainedIdentifier.h"
 42               #include "CQLChainedIdentifierRep.h"
 43               #include <Pegasus/CQL/CQLFactory.h>
 44               PEGASUS_NAMESPACE_BEGIN
 45               
 46               /*
 47               #define PEGASUS_ARRAY_T CQLChainedIdentifier
 48               #include <Pegasus/Common/ArrayImpl.h>
 49               #undef PEGASUS_ARRAY_T
 50               */
 51               
 52               CQLChainedIdentifier::CQLChainedIdentifier():
 53 humberto  1.3 	QueryChainedIdentifier()
 54 chuck     1.2 {
 55 humberto  1.3 	if(_rep) 
 56               		delete _rep;
 57               	_rep = NULL;
 58 chuck     1.2 	_rep = new CQLChainedIdentifierRep();
 59               }
 60               
 61 aruran.ms 1.6 CQLChainedIdentifier::CQLChainedIdentifier(const String& inString):
 62 humberto  1.3 	QueryChainedIdentifier()
 63 chuck     1.2 {
 64 humberto  1.3 	if(_rep) 
 65               		delete _rep;
 66               	_rep = NULL;
 67 chuck     1.2 	_rep = new CQLChainedIdentifierRep(inString);
 68               }
 69               
 70               CQLChainedIdentifier::CQLChainedIdentifier(const CQLIdentifier &id):
 71 humberto  1.3 	QueryChainedIdentifier()
 72 chuck     1.2 {
 73 humberto  1.3 	if(_rep) 
 74               		delete _rep;
 75               	_rep = NULL;
 76                  _rep = new CQLChainedIdentifierRep(id);
 77 chuck     1.2 }
 78               
 79               CQLChainedIdentifier::CQLChainedIdentifier(const CQLChainedIdentifier& cid):
 80 humberto  1.3 QueryChainedIdentifier()
 81 chuck     1.2 {
 82 humberto  1.3 	if(_rep) 
 83               		delete _rep;
 84               	_rep = NULL;
 85                  _rep = new QueryChainedIdentifierRep(cid._rep);
 86 chuck     1.2 }
 87               
 88               CQLChainedIdentifier::~CQLChainedIdentifier()
 89               {
 90               	if(_rep)
 91               		delete _rep;
 92                  _rep = NULL;
 93               }
 94               
 95               Array<CQLIdentifier> CQLChainedIdentifier::getSubIdentifiers()const
 96               {
 97                 Array<CQLIdentifier> result;
 98                 Array<QueryIdentifier> qIds = _rep->getSubIdentifiers();
 99                 for (Uint32 i = 0; i < qIds.size(); i++)
100                 {
101                   CQLIdentifier cid(qIds[i]);
102                   result.append(cid);
103                 }
104               
105                 return result;
106               }
107 chuck     1.2 
108               CQLIdentifier CQLChainedIdentifier::getLastIdentifier()const{
109               	QueryIdentifier qid = _rep->getLastIdentifier();
110                  return CQLIdentifier(qid);
111               }
112               
113               CQLIdentifier CQLChainedIdentifier::operator[](Uint32 index)const
114               {
115               	QueryIdentifier qid = _rep->operator[](index);
116                  return CQLIdentifier(qid);
117               }
118               
119               CQLChainedIdentifier& CQLChainedIdentifier::operator=(const CQLChainedIdentifier& rhs)
120               {
121               	if(&rhs != this)
122                  {
123                    if(_rep) delete _rep;
124                    _rep = new QueryChainedIdentifierRep(rhs._rep);
125               	}
126               	return *this;
127               }
128 chuck     1.2 
129               PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2