Moses::StringVector< ValueT, PosT, Allocator > Class Template Reference

#include <StringVector.h>

Inheritance diagram for Moses::StringVector< ValueT, PosT, Allocator >:

Inheritance graph
[legend]
Collaboration diagram for Moses::StringVector< ValueT, PosT, Allocator >:

Collaboration graph
[legend]

List of all members.

Classes

class  RangeIterator
class  StringIterator

Public Types

typedef ValueIteratorRange
< const ValueT * > 
range
typedef RangeIterator iterator
typedef StringIterator string_iterator

Public Member Functions

 StringVector (bool allocate=false)
 StringVector (Allocator< ValueT > &alloc)
virtual ~StringVector ()
void swap (StringVector< ValueT, PosT, Allocator > &c)
bool is_sorted () const
PosT size () const
virtual PosT size2 () const
template<class Iterator >
Iterator begin () const
template<class Iterator >
Iterator end () const
iterator begin () const
iterator end () const
PosT length (PosT i) const
const ValueT * begin (PosT i) const
const ValueT * end (PosT i) const
void clear ()
range at (PosT i) const
range operator[] (PosT i) const
range back () const
template<typename StringT >
void push_back (StringT s)
void push_back (const char *c)
template<typename StringT >
PosT find (StringT &s) const
PosT find (const char *c) const
virtual size_t load (std::FILE *in, bool memoryMapped=false)
size_t loadCharArray (std::vector< ValueT, std::allocator< ValueT > > *&c, std::FILE *in, bool map=false)
size_t loadCharArray (std::vector< ValueT, MmapAllocator< ValueT > > *&c, std::FILE *in, bool map=false)
size_t load (std::string filename, bool memoryMapped=false)
size_t save (std::FILE *out)
size_t save (std::string filename)

Protected Member Functions

virtual const ValueT * value_ptr (PosT i) const

Protected Attributes

bool m_sorted
bool m_memoryMapped
std::vector< ValueT, Allocator
< ValueT > > * 
m_charArray
MonotonicVector< PosT,
unsigned int, 32 > 
m_positions


Detailed Description

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
class Moses::StringVector< ValueT, PosT, Allocator >

Definition at line 77 of file StringVector.h.


Member Typedef Documentation

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
typedef RangeIterator Moses::StringVector< ValueT, PosT, Allocator >::iterator

Definition at line 147 of file StringVector.h.

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
typedef ValueIteratorRange<const ValueT *> Moses::StringVector< ValueT, PosT, Allocator >::range

Definition at line 90 of file StringVector.h.

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
typedef StringIterator Moses::StringVector< ValueT, PosT, Allocator >::string_iterator

Definition at line 148 of file StringVector.h.


Constructor & Destructor Documentation

template<typename ValueT , typename PosT , template< typename > class Allocator>
Moses::StringVector< ValueT, PosT, Allocator >::StringVector ( bool  allocate = false  )  [inline]

Definition at line 370 of file StringVector.h.

template<typename ValueT, typename PosT , template< typename > class Allocator>
Moses::StringVector< ValueT, PosT, Allocator >::StringVector ( Allocator< ValueT > &  alloc  )  [inline]

Definition at line 375 of file StringVector.h.

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
virtual Moses::StringVector< ValueT, PosT, Allocator >::~StringVector (  )  [inline, virtual]

Definition at line 153 of file StringVector.h.


Member Function Documentation

template<typename ValueT , typename PosT, template< typename > class Allocator>
StringVector< ValueT, PosT, Allocator >::range Moses::StringVector< ValueT, PosT, Allocator >::at ( PosT  i  )  const [inline]

template<typename ValueT , typename PosT , template< typename > class Allocator>
StringVector< ValueT, PosT, Allocator >::range Moses::StringVector< ValueT, PosT, Allocator >::back (  )  const [inline]

Definition at line 453 of file StringVector.h.

References Moses::StringVector< ValueT, PosT, Allocator >::at(), and Moses::StringVector< ValueT, PosT, Allocator >::size().

Referenced by Moses::BlockHashIndex::AddRange(), and Moses::StringVector< ValueT, PosT, Allocator >::push_back().

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename ValueT , typename PosT, template< typename > class Allocator>
const ValueT * Moses::StringVector< ValueT, PosT, Allocator >::begin ( PosT  i  )  const [inline]

Definition at line 475 of file StringVector.h.

References Moses::StringVector< ValueT, PosT, Allocator >::value_ptr().

Here is the call graph for this function:

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
iterator Moses::StringVector< ValueT, PosT, Allocator >::begin (  )  const

template<typename ValueT , typename PosT , template< typename > class Allocator>
template<typename Iterator >
StringVector< ValueT, PosT, Allocator >::iterator Moses::StringVector< ValueT, PosT, Allocator >::begin (  )  const [inline]

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
void Moses::StringVector< ValueT, PosT, Allocator >::clear (  )  [inline]

Definition at line 183 of file StringVector.h.

template<typename ValueT , typename PosT, template< typename > class Allocator>
const ValueT * Moses::StringVector< ValueT, PosT, Allocator >::end ( PosT  i  )  const [inline]

Definition at line 483 of file StringVector.h.

References Moses::StringVector< ValueT, PosT, Allocator >::length(), and Moses::StringVector< ValueT, PosT, Allocator >::value_ptr().

Here is the call graph for this function:

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
iterator Moses::StringVector< ValueT, PosT, Allocator >::end (  )  const

template<typename ValueT , typename PosT , template< typename > class Allocator>
template<typename Iterator >
StringVector< ValueT, PosT, Allocator >::iterator Moses::StringVector< ValueT, PosT, Allocator >::end (  )  const [inline]

Definition at line 405 of file StringVector.h.

References Moses::StringVector< ValueT, PosT, Allocator >::size().

Referenced by Moses::StringVector< ValueT, PosT, Allocator >::at(), Moses::StringVector< ValueT, PosT, Allocator >::find(), and Moses::BlockHashIndex::GetHash().

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename ValueT , typename PosT , template< typename > class Allocator>
PosT Moses::StringVector< ValueT, PosT, Allocator >::find ( const char *  c  )  const [inline]

Definition at line 499 of file StringVector.h.

References Moses::StringVector< ValueT, PosT, Allocator >::find().

Here is the call graph for this function:

template<typename ValueT , typename PosT , template< typename > class Allocator>
template<typename StringT >
PosT Moses::StringVector< ValueT, PosT, Allocator >::find ( StringT &  s  )  const [inline]

template<typename ValueT , typename PosT , template< typename > class Allocator>
bool Moses::StringVector< ValueT, PosT, Allocator >::is_sorted (  )  const [inline]

Definition at line 423 of file StringVector.h.

References Moses::StringVector< ValueT, PosT, Allocator >::m_sorted.

Referenced by Moses::StringVector< ValueT, PosT, Allocator >::push_back().

Here is the caller graph for this function:

template<typename ValueT , typename PosT, template< typename > class Allocator>
PosT Moses::StringVector< ValueT, PosT, Allocator >::length ( PosT  i  )  const [inline]

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
size_t Moses::StringVector< ValueT, PosT, Allocator >::load ( std::string  filename,
bool  memoryMapped = false 
) [inline]

Definition at line 255 of file StringVector.h.

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
virtual size_t Moses::StringVector< ValueT, PosT, Allocator >::load ( std::FILE *  in,
bool  memoryMapped = false 
) [inline, virtual]

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
size_t Moses::StringVector< ValueT, PosT, Allocator >::loadCharArray ( std::vector< ValueT, MmapAllocator< ValueT > > *&  c,
std::FILE *  in,
bool  map = false 
) [inline]

Definition at line 228 of file StringVector.h.

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
size_t Moses::StringVector< ValueT, PosT, Allocator >::loadCharArray ( std::vector< ValueT, std::allocator< ValueT > > *&  c,
std::FILE *  in,
bool  map = false 
) [inline]

Definition at line 212 of file StringVector.h.

template<typename ValueT , typename PosT, template< typename > class Allocator>
StringVector< ValueT, PosT, Allocator >::range Moses::StringVector< ValueT, PosT, Allocator >::operator[] ( PosT  i  )  const [inline]

Definition at line 447 of file StringVector.h.

References Moses::StringVector< ValueT, PosT, Allocator >::at().

Here is the call graph for this function:

template<typename ValueT , typename PosT , template< typename > class Allocator>
void Moses::StringVector< ValueT, PosT, Allocator >::push_back ( const char *  c  )  [inline]

Definition at line 390 of file StringVector.h.

References Moses::StringVector< ValueT, PosT, Allocator >::push_back().

Here is the call graph for this function:

template<typename ValueT , typename PosT , template< typename > class Allocator>
template<typename StringT >
void Moses::StringVector< ValueT, PosT, Allocator >::push_back ( StringT  s  )  [inline]

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
size_t Moses::StringVector< ValueT, PosT, Allocator >::save ( std::string  filename  )  [inline]

Definition at line 275 of file StringVector.h.

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
size_t Moses::StringVector< ValueT, PosT, Allocator >::save ( std::FILE *  out  )  [inline]

Definition at line 262 of file StringVector.h.

Referenced by Moses::BlockHashIndex::FinalizeSave().

Here is the caller graph for this function:

template<typename ValueT , typename PosT , template< typename > class Allocator>
PosT Moses::StringVector< ValueT, PosT, Allocator >::size (  )  const [inline]

template<typename ValueT , typename PosT , template< typename > class Allocator>
PosT Moses::StringVector< ValueT, PosT, Allocator >::size2 (  )  const [inline, virtual]

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
void Moses::StringVector< ValueT, PosT, Allocator >::swap ( StringVector< ValueT, PosT, Allocator > &  c  )  [inline]

Definition at line 157 of file StringVector.h.

template<typename ValueT , typename PosT, template< typename > class Allocator>
const ValueT * Moses::StringVector< ValueT, PosT, Allocator >::value_ptr ( PosT  i  )  const [inline, protected, virtual]


Member Data Documentation

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
std::vector<ValueT, Allocator<ValueT> >* Moses::StringVector< ValueT, PosT, Allocator >::m_charArray [protected]

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
bool Moses::StringVector< ValueT, PosT, Allocator >::m_memoryMapped [protected]

Definition at line 81 of file StringVector.h.

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
MonotonicVector<PosT, unsigned int, 32> Moses::StringVector< ValueT, PosT, Allocator >::m_positions [protected]

template<typename ValueT = unsigned char, typename PosT = unsigned int, template< typename > class Allocator = std::allocator>
bool Moses::StringVector< ValueT, PosT, Allocator >::m_sorted [protected]


The documentation for this class was generated from the following file:

Generated on Thu Jul 6 00:33:39 2017 for Moses by  doxygen 1.5.9