• Main Page
  • Classes
  • Files
  • File List

/var/tmp/axbld-24884/rpm/BUILD/pegasus/src/Pegasus/Common/ArrayInter.h

00001 //%LICENSE////////////////////////////////////////////////////////////////
00002 //
00003 // Licensed to The Open Group (TOG) under one or more contributor license
00004 // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
00005 // this work for additional information regarding copyright ownership.
00006 // Each contributor licenses this file to you under the OpenPegasus Open
00007 // Source License; you may not use this file except in compliance with the
00008 // License.
00009 //
00010 // Permission is hereby granted, free of charge, to any person obtaining a
00011 // copy of this software and associated documentation files (the "Software"),
00012 // to deal in the Software without restriction, including without limitation
00013 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
00014 // and/or sell copies of the Software, and to permit persons to whom the
00015 // Software is furnished to do so, subject to the following conditions:
00016 //
00017 // The above copyright notice and this permission notice shall be included
00018 // in all copies or substantial portions of the Software.
00019 //
00020 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00021 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00022 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00023 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00024 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00025 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00026 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00027 //
00029 //
00030 //%/////////////////////////////////////////////////////////////////////////////
00031 
00032 // Only include if not included as general template or if explicit instantiation
00033 #if !defined(Pegasus_ArrayInter_h) || defined(PEGASUS_ARRAY_T)
00034 #if !defined(PEGASUS_ARRAY_T)
00035 #define Pegasus_ArrayInter_h
00036 #endif
00037 
00038 #include <Pegasus/Common/Linkage.h>
00039 
00040 #ifndef PEGASUS_ARRAY_T
00041 
00044 template<class PEGASUS_ARRAY_T> class Array
00045 #else
00046 PEGASUS_TEMPLATE_SPECIALIZATION
00047     class PEGASUS_COMMON_LINKAGE Array<PEGASUS_ARRAY_T>
00048 #endif
00049 {
00050 public:
00051 
00055     Array();
00056 
00062     Array(const Array<PEGASUS_ARRAY_T>& x);
00063 
00069     Array(Uint32 size);
00070 
00077     Array(Uint32 size, const PEGASUS_ARRAY_T& x);
00078 
00085     Array(const PEGASUS_ARRAY_T* items, Uint32 size);
00086 
00090     ~Array();
00091 
00097     Array<PEGASUS_ARRAY_T>& operator=(const Array<PEGASUS_ARRAY_T>& x);
00098 
00103     void clear();
00104 
00114     void reserveCapacity(Uint32 capacity);
00115 
00124     void grow(Uint32 size, const PEGASUS_ARRAY_T& x);
00125 
00132     void swap(Array<PEGASUS_ARRAY_T>& x);
00133 
00138     Uint32 size() const;
00139 
00144     Uint32 getCapacity() const;
00145 
00150     const PEGASUS_ARRAY_T* getData() const;
00151 
00157     PEGASUS_ARRAY_T& operator[](Uint32 index);
00158 
00165     const PEGASUS_ARRAY_T& operator[](Uint32 index) const;
00166 
00172     void append(const PEGASUS_ARRAY_T& x);
00173 
00179     void append(const PEGASUS_ARRAY_T* x, Uint32 size);
00180 
00186     void appendArray(const Array<PEGASUS_ARRAY_T>& x);
00187 
00193     void prepend(const PEGASUS_ARRAY_T& x);
00194 
00200     void prepend(const PEGASUS_ARRAY_T* x, Uint32 size);
00201 
00208     void insert(Uint32 index, const PEGASUS_ARRAY_T& x);
00209 
00218     void insert(Uint32 index, const PEGASUS_ARRAY_T* x, Uint32 size);
00219 
00225     void remove(Uint32 index);
00226 
00234     void remove(Uint32 index, Uint32 size);
00235 
00236 private:
00237 
00238     PEGASUS_ARRAY_T* _data() const;
00239 
00240     void* _rep;
00241 };
00242 
00243 #endif