19#if !defined(XALANVECTOR_HEADER_GUARD_1357924680)
20#define XALANVECTOR_HEADER_GUARD_1357924680
48#pragma warning(disable: 4100)
53using xercesc::MemoryManager;
57template <
class Type,
class ConstructionTraits = MemoryManagedConstructionTraits<Type> >
200 if (m_allocation != 0)
202 destroy(begin(), end());
225 destroy(m_data[m_size]);
299 assert (m_memoryManager != 0);
404 assert ( m_memoryManager != 0 );
483 if (m_allocation > m_size)
582 Constructor::construct(data,
theValue, *m_memoryManager);
604 return m_size == 0 ?
true :
false;
639 return m_data[m_size - 1];
645 return m_data[m_size - 1];
688 const_reverse_iterator
704 const_reverse_iterator
772 if (m_allocation <
theRHS.m_size)
782 if (m_size >
theRHS.m_size)
785 shrinkToSize(
theRHS.m_size);
787 else if (m_size <
theRHS.m_size)
823 m_memoryManager =
theOther.m_memoryManager;
825 m_allocation =
theOther.m_allocation;
839 assert (m_memoryManager != 0);
841 return *m_memoryManager;
847 assert (m_memoryManager != 0);
849 return *m_memoryManager;
880 assert(m_allocation >= m_size);
882 (m_data == 0 && m_allocation == 0) ||
883 (m_data != 0 && m_allocation != 0));
889 const_iterator theFirst,
890 const_iterator theLast)
894 assert(theFirst <= theLast);
896 return std::distance(theFirst, theLast);
900 allocate(size_type size)
902 const size_type theBytesNeeded = size *
sizeof(value_type);
904 assert (m_memoryManager != 0);
906 void* pointer = m_memoryManager->allocate(theBytesNeeded);
908 assert(pointer != 0);
910 return (value_type*) pointer;
914 deallocate(value_type* pointer)
916 assert(m_memoryManager != 0);
918 m_memoryManager->deallocate(pointer);
923 destroy(value_type& theValue)
933 for(; theFirst != theLast; ++theFirst)
940 grow(
const value_type& data)
944 assert(m_size != 0 && m_size == m_allocation);
947 assert(theNewSize > m_size);
949 ThisType theTemp(*
this, *m_memoryManager, theNewSize);
951 theTemp.doPushBack(data);
959 construct_back(
const value_type& data)
963 assert(m_size < m_allocation);
965 Constructor::construct(
976 init(
const value_type& data)
980 assert(m_size == 0 && m_allocation == 0);
982 m_data = allocate(1);
986 construct_back(data);
992 doPushBack(
const value_type& data)
996 if (m_size < m_allocation)
998 construct_back(data);
1000 else if (m_size == 0)
1013 ensureCapacity(size_type theSize)
1015 if (theSize > capacity())
1020 return endPointer();
1024 doReserve(size_type theSize)
1028 assert(theSize > m_allocation);
1030 ThisType theTemp(*
this, *m_memoryManager, theSize);
1040 return m_data + m_size;
1046 return m_data + m_size;
1052 throw std::out_of_range(
"");
1056 shrinkToSize(size_type theSize)
1058 assert(m_size > theSize);
1063 }
while (m_size > theSize);
1067 shrinkCount(size_type theCount)
1069 assert(m_size >= theCount);
1071 while (theCount > 0)
1084 return theLHS > theRHS ? theLHS : theRHS;
1087#if defined(XALAN_DEVELOPMENT)
1089 XalanVector(
const XalanVector&);
1094 MemoryManager* m_memoryManager;
1105template <
class Type>
1116template <
class Type>
1126 else if (
theLHS.size() == 0)
1138template <
class Type>
1149template <
class Type>
1155 return std::lexicographical_compare(
1164template <
class Type>
1175template <
class Type>
1186template <
class Type>
1197#if defined(_MSC_VER)
#define XALAN_DEFAULT_CONSTRUCTOR_MEMMGR
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
MemMgrAutoPtrData release()
MemoryManager & getMemoryManager()
reference at(size_type theIndex)
XalanVector(MemoryManager &theManager XALAN_DEFAULT_CONSTRUCTOR_MEMMGR, size_type initialAllocation=size_type(0))
const value_type & const_reference
void swap(ThisType &theOther)
void insert(iterator thePosition, const_iterator theFirst, const_iterator theLast)
iterator erase(iterator position)
void push_back(const value_type &data)
const_reference at(size_type theIndex) const
static XalanVector * create(const_iterator theFirst, const_iterator theLast, MemoryManager &theManager)
const_reference front() const
XalanVector(size_type theInsertSize, const value_type &theData, MemoryManager &theManager)
void assign(iterator theFirst, iterator theLast)
const value_type * const_pointer
XalanVector(const ThisType &theSource, MemoryManager &theManager XALAN_DEFAULT_CONSTRUCTOR_MEMMGR, size_type theInitialAllocation=size_type(0))
ConstructionTraits::Constructor Constructor
size_type max_size() const
iterator insert(iterator thePosition, const value_type &theData)
const_iterator end() const
const value_type * const_iterator
const_reference back() const
const_reverse_iterator_ const_reverse_iterator
static XalanVector * create(MemoryManager &theManager, size_type initialAllocation=size_type(0))
XalanVector(const_iterator theFirst, const_iterator theLast, MemoryManager &theManager)
const_reference operator[](size_type theIndex) const
const_reverse_iterator rbegin() const
const_iterator begin() const
XalanVector< value_type, ConstructionTraits > ThisType
const_reverse_iterator rend() const
std::reverse_iterator< iterator > reverse_iterator_
void resize(size_type theSize, const value_type &theValue)
void assign(size_type theCount, const value_type &theData)
iterator erase(iterator theFirst, iterator theLast)
ThisType & operator=(const ThisType &theRHS)
ptrdiff_t difference_type
Constructor::ConstructableType ConstructibleType
reverse_iterator_ reverse_iterator
const MemoryManager & getMemoryManager() const
reverse_iterator rbegin()
std::reverse_iterator< const_iterator > const_reverse_iterator_
size_type capacity() const
reference operator[](size_type theIndex)
void assign(const_iterator theFirst, const_iterator theLast)
void reserve(size_type theSize)
void insert(iterator thePosition, size_type theCount, const value_type &theData)
void resize(size_type theSize)
void clear(XalanDOMString &theString)
Remove all elements from target string.
XalanDOMString & insert(XalanDOMString &theString, XalanDOMString::size_type thePosition, const XalanDOMString &theStringToInsert)
Insert a string into another string.
void erase(XalanDOMString &theString)
Remove all elements from target string.
void swap(XalanVector< Type > &theLHS, XalanVector< Type > &theRHS)
XalanDOMString & assign(XalanDOMString &theString, const XalanDOMString &theStringToAssign)
Assign one string to another.
void reserve(XalanDOMString &theString, XalanDOMString::size_type theCount)
Reserve some space in the string for more efficient concatenation...
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
bool operator!=(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
bool operator>(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
bool operator>=(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)