version 1.13, 2002/05/28 22:13:48
|
version 1.26, 2005/02/05 22:59:23
|
|
|
//%///////////////////////////////////////////////////////////////////////////// |
//%2005//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
|
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation, The Open Group. |
|
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; VERITAS Software Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
//#if defined(PEGASUS_EXPLICIT_INSTANTIATION) || !defined(PEGASUS_ARRAY_T) |
|
// Only include if not included as general template or if explicit instantiation | // Only include if not included as general template or if explicit instantiation |
#if !defined(Pegasus_ArrayImpl_h) || defined(PEGASUS_ARRAY_T) | #if !defined(Pegasus_ArrayImpl_h) || defined(PEGASUS_ARRAY_T) |
#if !defined(PEGASUS_ARRAY_T) | #if !defined(PEGASUS_ARRAY_T) |
|
|
| |
#include <Pegasus/Common/Memory.h> | #include <Pegasus/Common/Memory.h> |
#include <Pegasus/Common/ArrayRep.h> | #include <Pegasus/Common/ArrayRep.h> |
|
#include <Pegasus/Common/InternalException.h> |
#ifdef PEGASUS_HAS_EBCDIC |
|
#include <unistd.h> |
|
#endif |
|
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
Array<PEGASUS_ARRAY_T>::Array() | Array<PEGASUS_ARRAY_T>::Array() |
{ | { |
|
|
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
Array<PEGASUS_ARRAY_T>::Array(const Array<PEGASUS_ARRAY_T>& x) | Array<PEGASUS_ARRAY_T>::Array(const Array<PEGASUS_ARRAY_T>& x) |
{ | { |
|
|
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
Array<PEGASUS_ARRAY_T>::Array(Uint32 size) | Array<PEGASUS_ARRAY_T>::Array(Uint32 size) |
{ | { |
_rep = ArrayRep<PEGASUS_ARRAY_T>::create(size); | _rep = ArrayRep<PEGASUS_ARRAY_T>::create(size); |
|
|
|
if (_rep == 0) |
|
{ |
|
throw NullPointer(); |
|
} |
|
|
InitializeRaw(static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data(), size); | InitializeRaw(static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data(), size); |
} | } |
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
Array<PEGASUS_ARRAY_T>::Array(Uint32 size, const PEGASUS_ARRAY_T& x) | Array<PEGASUS_ARRAY_T>::Array(Uint32 size, const PEGASUS_ARRAY_T& x) |
{ | { |
_rep = ArrayRep<PEGASUS_ARRAY_T>::create(size); | _rep = ArrayRep<PEGASUS_ARRAY_T>::create(size); |
| |
|
if (_rep == 0) |
|
{ |
|
throw NullPointer(); |
|
} |
|
|
PEGASUS_ARRAY_T* data = static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data(); | PEGASUS_ARRAY_T* data = static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data(); |
| |
while (size--) | while (size--) |
|
|
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
Array<PEGASUS_ARRAY_T>::Array(const PEGASUS_ARRAY_T* items, Uint32 size) | Array<PEGASUS_ARRAY_T>::Array(const PEGASUS_ARRAY_T* items, Uint32 size) |
{ | { |
_rep = ArrayRep<PEGASUS_ARRAY_T>::create(size); | _rep = ArrayRep<PEGASUS_ARRAY_T>::create(size); |
|
|
|
if (_rep == 0) |
|
{ |
|
throw NullPointer(); |
|
} |
|
|
CopyToRaw(static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data(), items, size); | CopyToRaw(static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data(), items, size); |
} | } |
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
Array<PEGASUS_ARRAY_T>::~Array() | Array<PEGASUS_ARRAY_T>::~Array() |
{ | { |
|
|
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
Array<PEGASUS_ARRAY_T>& Array<PEGASUS_ARRAY_T>::operator=( | Array<PEGASUS_ARRAY_T>& Array<PEGASUS_ARRAY_T>::operator=( |
const Array<PEGASUS_ARRAY_T>& x) | const Array<PEGASUS_ARRAY_T>& x) |
|
|
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
void Array<PEGASUS_ARRAY_T>::clear() | void Array<PEGASUS_ARRAY_T>::clear() |
{ | { |
|
|
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
void Array<PEGASUS_ARRAY_T>::reserve(Uint32 capacity) |
void Array<PEGASUS_ARRAY_T>::reserveCapacity(Uint32 capacity) |
{ | { |
if (capacity > static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->capacity) | if (capacity > static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->capacity) |
{ | { |
Uint32 size = this->size(); | Uint32 size = this->size(); |
ArrayRep<PEGASUS_ARRAY_T>* rep = ArrayRep<PEGASUS_ARRAY_T>::create(capacity); |
ArrayRep<PEGASUS_ARRAY_T>* rep = |
|
ArrayRep<PEGASUS_ARRAY_T>::create(capacity); |
|
|
|
if (rep != 0) |
|
{ |
rep->size = size; | rep->size = size; |
CopyToRaw(rep->data(), static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data(), size); |
CopyToRaw( |
ArrayRep<PEGASUS_ARRAY_T>::destroy(static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)); |
rep->data(), |
|
static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data(), |
|
size); |
|
ArrayRep<PEGASUS_ARRAY_T>::destroy( |
|
static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)); |
_rep = rep; | _rep = rep; |
} | } |
} | } |
|
} |
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
void Array<PEGASUS_ARRAY_T>::grow(Uint32 size, const PEGASUS_ARRAY_T& x) | void Array<PEGASUS_ARRAY_T>::grow(Uint32 size, const PEGASUS_ARRAY_T& x) |
{ | { |
Uint32 oldSize = static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size; | Uint32 oldSize = static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size; |
reserve(oldSize + size); |
reserveCapacity(oldSize + size); |
| |
PEGASUS_ARRAY_T* p = static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data() + oldSize; | PEGASUS_ARRAY_T* p = static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data() + oldSize; |
Uint32 n = size; | Uint32 n = size; |
|
|
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
void Array<PEGASUS_ARRAY_T>::swap(Array<PEGASUS_ARRAY_T>& x) | void Array<PEGASUS_ARRAY_T>::swap(Array<PEGASUS_ARRAY_T>& x) |
{ | { |
|
|
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
Uint32 Array<PEGASUS_ARRAY_T>::size() const | Uint32 Array<PEGASUS_ARRAY_T>::size() const |
{ | { |
|
|
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
Uint32 Array<PEGASUS_ARRAY_T>::getCapacity() const | Uint32 Array<PEGASUS_ARRAY_T>::getCapacity() const |
{ | { |
|
|
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
const PEGASUS_ARRAY_T* Array<PEGASUS_ARRAY_T>::getData() const | const PEGASUS_ARRAY_T* Array<PEGASUS_ARRAY_T>::getData() const |
{ | { |
|
|
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
PEGASUS_ARRAY_T& Array<PEGASUS_ARRAY_T>::operator[](Uint32 pos) |
PEGASUS_ARRAY_T& Array<PEGASUS_ARRAY_T>::operator[](Uint32 index) |
{ | { |
if (pos >= size()) |
if (index >= size()) |
ThrowOutOfBounds(); |
throw IndexOutOfBoundsException(); |
| |
return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data()[pos]; |
return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data()[index]; |
} | } |
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
const PEGASUS_ARRAY_T& Array<PEGASUS_ARRAY_T>::operator[](Uint32 pos) const |
const PEGASUS_ARRAY_T& Array<PEGASUS_ARRAY_T>::operator[](Uint32 index) const |
{ | { |
if (pos >= size()) |
if (index >= size()) |
ThrowOutOfBounds(); |
throw IndexOutOfBoundsException(); |
| |
return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data()[pos]; |
return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data()[index]; |
} | } |
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
void Array<PEGASUS_ARRAY_T>::append(const PEGASUS_ARRAY_T& x) | void Array<PEGASUS_ARRAY_T>::append(const PEGASUS_ARRAY_T& x) |
{ | { |
reserve(size() + 1); |
reserveCapacity(size() + 1); |
new (_data() + size()) PEGASUS_ARRAY_T(x); | new (_data() + size()) PEGASUS_ARRAY_T(x); |
static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size++; | static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size++; |
} | } |
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
void Array<PEGASUS_ARRAY_T>::append(const PEGASUS_ARRAY_T* x, Uint32 size) | void Array<PEGASUS_ARRAY_T>::append(const PEGASUS_ARRAY_T* x, Uint32 size) |
{ | { |
reserve(this->size() + size); |
reserveCapacity(this->size() + size); |
CopyToRaw(_data() + this->size(), x, size); | CopyToRaw(_data() + this->size(), x, size); |
static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size += size; | static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size += size; |
} | } |
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
void Array<PEGASUS_ARRAY_T>::appendArray(const Array<PEGASUS_ARRAY_T>& x) | void Array<PEGASUS_ARRAY_T>::appendArray(const Array<PEGASUS_ARRAY_T>& x) |
{ | { |
|
|
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
void Array<PEGASUS_ARRAY_T>::prepend(const PEGASUS_ARRAY_T& x) | void Array<PEGASUS_ARRAY_T>::prepend(const PEGASUS_ARRAY_T& x) |
{ | { |
|
|
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
void Array<PEGASUS_ARRAY_T>::prepend(const PEGASUS_ARRAY_T* x, Uint32 size) | void Array<PEGASUS_ARRAY_T>::prepend(const PEGASUS_ARRAY_T* x, Uint32 size) |
{ | { |
reserve(this->size() + size); |
reserveCapacity(this->size() + size); |
memmove(_data() + size, _data(), sizeof(PEGASUS_ARRAY_T) * this->size()); | memmove(_data() + size, _data(), sizeof(PEGASUS_ARRAY_T) * this->size()); |
CopyToRaw(_data(), x, size); | CopyToRaw(_data(), x, size); |
static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size += size; | static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size += size; |
|
|
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
void Array<PEGASUS_ARRAY_T>::insert(Uint32 pos, const PEGASUS_ARRAY_T& x) |
void Array<PEGASUS_ARRAY_T>::insert(Uint32 index, const PEGASUS_ARRAY_T& x) |
{ | { |
insert(pos, &x, 1); |
insert(index, &x, 1); |
} | } |
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
void Array<PEGASUS_ARRAY_T>::insert(Uint32 pos, const PEGASUS_ARRAY_T* x, Uint32 size) |
void Array<PEGASUS_ARRAY_T>::insert(Uint32 index, const PEGASUS_ARRAY_T* x, Uint32 size) |
{ | { |
if (pos > this->size()) |
if (index > this->size()) |
ThrowOutOfBounds(); |
throw IndexOutOfBoundsException(); |
| |
reserve(this->size() + size); |
reserveCapacity(this->size() + size); |
| |
Uint32 n = this->size() - pos; |
Uint32 n = this->size() - index; |
| |
if (n) | if (n) |
memmove( |
memmove(_data() + index + size, |
_data() + pos + size, _data() + pos, sizeof(PEGASUS_ARRAY_T) * n); |
_data() + index, |
|
sizeof(PEGASUS_ARRAY_T) * n); |
| |
CopyToRaw(_data() + pos, x, size); |
CopyToRaw(_data() + index, x, size); |
static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size += size; | static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size += size; |
} | } |
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
void Array<PEGASUS_ARRAY_T>::remove(Uint32 pos) |
void Array<PEGASUS_ARRAY_T>::remove(Uint32 index) |
{ | { |
remove(pos, 1); |
remove(index, 1); |
} | } |
| |
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
void Array<PEGASUS_ARRAY_T>::remove(Uint32 pos, Uint32 size) |
void Array<PEGASUS_ARRAY_T>::remove(Uint32 index, Uint32 size) |
{ | { |
if (pos + size - 1 > this->size()) |
if (index + size - 1 > this->size()) |
ThrowOutOfBounds(); |
throw IndexOutOfBoundsException(); |
| |
Destroy(_data() + pos, size); |
Destroy(_data() + index, size); |
| |
Uint32 rem = this->size() - (pos + size); |
Uint32 rem = this->size() - (index + size); |
| |
if (rem) | if (rem) |
memmove( |
memmove(_data() + index, |
_data() + pos, _data() + pos + size, sizeof(PEGASUS_ARRAY_T) * rem); |
_data() + index + size, |
|
sizeof(PEGASUS_ARRAY_T) * rem); |
| |
static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size -= size; | static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size -= size; |
} | } |
| |
#ifdef PEGASUS_HAS_EBCDIC |
|
|
|
#ifndef PEGASUS_ARRAY_T |
|
template<class PEGASUS_ARRAY_T> |
|
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif |
|
void Array<PEGASUS_ARRAY_T>::etoa() |
|
{ |
|
#if PEGASUS_ARRAY_T == Sint8 |
|
__etoa_l((char *)_data(),static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size); |
|
#endif |
|
} |
|
|
|
#ifndef PEGASUS_ARRAY_T |
|
template<class PEGASUS_ARRAY_T> |
|
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif |
|
void Array<PEGASUS_ARRAY_T>::atoe() |
|
{ |
|
#if PEGASUS_ARRAY_T == Sint8 |
|
__atoe_l((char *)_data(),static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size); |
|
#endif |
|
} |
|
|
|
#endif |
|
|
|
#ifndef PEGASUS_ARRAY_T |
|
template<class PEGASUS_ARRAY_T> |
|
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif |
|
PEGASUS_ARRAY_T* Array<PEGASUS_ARRAY_T>::begin() |
|
{ |
|
return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data(); |
|
} |
|
|
|
#ifndef PEGASUS_ARRAY_T |
|
template<class PEGASUS_ARRAY_T> |
|
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif |
|
PEGASUS_ARRAY_T* Array<PEGASUS_ARRAY_T>::end() |
|
{ |
|
return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data() + size(); |
|
} |
|
|
|
#ifndef PEGASUS_ARRAY_T |
|
template<class PEGASUS_ARRAY_T> |
|
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif |
|
const PEGASUS_ARRAY_T* Array<PEGASUS_ARRAY_T>::begin() const |
|
{ |
|
return getData(); |
|
} |
|
|
|
#ifndef PEGASUS_ARRAY_T |
|
template<class PEGASUS_ARRAY_T> |
|
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif |
|
const PEGASUS_ARRAY_T* Array<PEGASUS_ARRAY_T>::end() const |
|
{ |
|
return getData() + size(); |
|
} |
|
|
|
#ifndef PEGASUS_ARRAY_T | #ifndef PEGASUS_ARRAY_T |
template<class PEGASUS_ARRAY_T> | template<class PEGASUS_ARRAY_T> |
#else |
|
PEGASUS_TEMPLATE_SPECIALIZATION |
|
#endif | #endif |
PEGASUS_ARRAY_T* Array<PEGASUS_ARRAY_T>::_data() const | PEGASUS_ARRAY_T* Array<PEGASUS_ARRAY_T>::_data() const |
{ | { |
|
|
} | } |
| |
#endif //!defined(Pegasus_ArrayImpl_h) || !defined(PEGASUS_ARRAY_T) | #endif //!defined(Pegasus_ArrayImpl_h) || !defined(PEGASUS_ARRAY_T) |
//#endif /*defined(PEGASUS_EXPLICIT_INSTANTIATION) || !defined(PEGASUS_ARRAY_T)*/ |
|