Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
concepts.h
1 /*
2  * $Id$
3  * Concepts documentation
4  *
5  * This file is part of OTAWA
6  * Copyright (c) 2007-08, IRIT UPS.
7  *
8  * OTAWA is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * OTAWA is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with OTAWA; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #include "../include/elm/equiv.h"
24 
25 namespace elm { namespace concept {
26 
74 template <class T>
75 class Iter {
76 public:
77 
82  bool ended(void);
83 
87  void next(void);
88 
94  T item(void);
95 
99  operator bool(void);
100 
104  operator T (void);
105 
109  Iter& operator++(int);
110 
116  Iter& operator=(const Iter& iterator);
117 
123  bool equals(const Iter& iterator) const;
124 
128  bool operator==(const Iter& iterator) const;
129 
133  bool operator!=(const Iter& iterator) const;
134 };
135 
136 
151 template <class T>
152 class MutableIter {
153 public:
154 
159  bool ended(void);
160 
164  void next(void);
165 
171  T& item(void);
172 
176  operator bool(void);
177 
181  MutableIter& operator++(int);
182 
188  MutableIter& operator=(const MutableIter& iterator);
189 
195  bool equals(const MutableIter& iterator) const;
196 
200  bool operator==(const MutableIter& iterator) const;
201 
205  bool operator!=(const MutableIter& iterator) const;
206 };
207 
208 
227 template <class T>
228 class Collection {
229 public:
230 
234  typedef T t;
235 
240 
245  int count(void);
246 
252  bool contains(const T& item);
253 
260  template <template <class _> class C>
261  bool containsAll(const C<T>& collection);
262 
267  bool isEmpty(void);
268 
272  operator bool(void);
273 
278  class Iter: public concept::Iter<T> {
279  public:
280 
285  Iter(const Collection<T>& collection);
286 
287  };
288 
293  Iter begin(void) const;
294 
299  Iter end(void) const;
300 
304  static const Collection null;
305 
306 
312  bool equals(const Collection& coll);
313 
317  bool operator==(const Collection& coll);
318 
322  bool operator!=(const Collection& coll);
323 
327  static const Collection<T> null;
328 };
329 
330 
347 template <class T>
348 class MutableCollection: public Collection<T> {
349 public:
350 
356 
362 
366  void clear(void);
367 
372  void add(const T& item);
373 
378  void addAll(const Collection<T>& items);
379 
384  void remove(const T& item);
385 
390  void removeAll(const Collection<T>& items);
391 
396  void remove(const Iterator<T>& iter);
397 
401  MutableCollection<T>& operator+=(const T& item);
402 
406  MutableCollection<T>& operator-=(const T& item);
407 
412  void copy(const Collection<T>& items);
413 
420 
421 };
422 
423 
442 template <class T>
443 class Set: public MutableCollection<T> {
444 public:
445 
451  void insert(const T& item);
452 
458  bool subsetOf(const Set& coll);
459 
463  bool operator>=(const Set& coll);
464 
468  bool operator<=(const Set& coll);
469 
473  bool operator>(const Set& coll);
474 
478  bool operator<(const Collection& coll);
479 
483  bool operator<=(const T& item);
484 
485 
490  void join(const Set<T>& set);
491 
496  void meet(const Set<T>& set);
497 
502  void diff(const Set<T>& set);
503 
507  Set<T> operator+=(const Set<T> set);
508 
512  Set<T> operator|=(const Set<T> set);
513 
517  Set<T> operator-=(const Set<T> set);
518 
522  Set<T> operator&=(const Set<T> set);
523 
527  Set<T> operator*=(const Set<T> set);
528 
533  Set<T> operator+(const Set& set);
534 
539  Set<T> operator|(const Set& set);
540 
545  Set<T> operator*(const Set& set);
546 
551  Set<T> operator&(const Set& set);
552 
557  Set<T> operator-(const Set& set);
558 
559 };
560 
561 
573 template <class T>
574 class Array: public Collection<T> {
575 public:
576 
580  int length(void);
581 
588  const T& get(int index) const;
589 
596  int indexOf(const T& value, int start = 0) const;
597 
604  int lastIndexOf(const T& value, int start = -1) const;
605 
609  const T& operator[](int index) const;
610 };
611 
612 
624 template <class T>
625 class MutableArray: public Array<T>, public MutableCollection<T> {
626 public:
627 
632  void shrink(int length);
633 
639  void set(int index, const T& item);
640 
646  void set(const Iterator& iter, const T& item);
647 
653  T& get(int index);
654 
658  T& operator[](int index);
659 
660 };
661 
662 
674 template <class T>
675 class ExpandableArray: public MutableArray<T>, public MutableCollection<T> {
676 public:
677 
682  void shrink(int length);
683 
690  void insert(int index, const T& item);
691 
698  void insert(const Iterator& iter, const T& item);
699 
705  void removeAt(int index);
706 
712  void removeAt(const Iterator& iter);
713 };
714 
715 
728 template <class T>
729 class Stack {
730 public:
731 
736  bool isEmpty(void) const;
737 
742  const T& top(void) const;
743 
749  T& top();
750 
755  T pop(void);
756 
761  void push(const T& item);
762 
766  void reset(void);
767 };
768 
769 
783 template <class T>
784 class Queue {
785 public:
786 
791  bool isEmpty(void) const;
792 
797  const T& head(void) const;
798 
803  T get(void);
804 
809  void put(const T& item);
810 
814  void reset(void);
815 
816 };
817 
818 
835 template <class T>
836 class Hash {
837 public:
838 
845  static t::uint32 hash(const T& object);
846 
854  static bool equals(const T& object1, const T& object2);
855 
861  t::uint32 computeHash(const T& object);
862 
870  bool isEqual(const T& object1, const T& object2);
871 
872 };
873 
874 
892 template <class T>
893 class Comparator {
894 public:
895 
904  static int compare(const T& object1, const T& object2);
905 
914  int doCompare(const T& object1, const T& object2);
915 
916 };
917 
918 
930 template <class T>
931 class Equiv {
932 public:
933 
941  static bool equals(const T& val1, const T& val2);
942 
950  static bool isEqual(const T& val1, const T& val2);
951 };
952 
953 
959 template <class T>
961 public:
962 
966  static const int EQUAL = 0x001;
967 
971  static const int LESS = 0x010;
972 
976  static const int GREATER = 0x100;
977 
981  static const int UNCOMP = 0x000;
982 
989  static bool equals(const T& v1, const T& v2);
990 
997  static bool greaterThan(const T& v1, const T& v2);
998 
1005  static bool lessThan(const T& v1, const T& v2);
1006 
1013  static int compare(const T& v1, const T& v2);
1014 };
1015 
1016 
1026 template <class K, class T>
1027 class Map: public Collection<T> {
1028 public:
1029 
1035  Option<const T&> get(const K& key) const;
1036 
1043  const T& get(const K& key, const T& def) const;
1044 
1050  bool hasKey(const K& key) const;
1051 
1055  class KeyIter: public Iter<K> {
1056  public:
1057 
1062  KeyIter(const Map<K, T>& map);
1063 
1068  KeyIter(const KeyIter& iter);
1069  };
1070 
1074  Iterable<KeyIter> keys() const;
1075 
1079  class PairIterator: public Iter<Pair<K, T> > {
1080  public:
1081 
1086  PairIterator(const Map<K, T>& map);
1087 
1093  };
1094 
1098  Iterable<PairIter> pairs() const;
1099 
1106  const T& operator[](const K& k) const;
1107 
1108 };
1109 
1110 
1120 template <class K, class T>
1121 class MutableMap: public Map<K, T> {
1122 public:
1123 
1127  void clear();
1128 
1134  void put(const K& key, const T& value);
1135 
1140  void removeByKey(const K& key);
1141 
1146  void remove(const Collection<T>::Iter& iter);
1147 
1155  T& operator[](const K& k);
1156 };
1157 
1158 
1169 template <class T>
1170 class List: public Collection<T> {
1171 public:
1172 
1177  const T& first(void) const;
1178 
1183  const T& last(void) const;
1184 
1190  Iter<T> find(const T& item);
1191 
1198  Iter<T> find(const T& item, const Iterator& start);
1199 
1206  Iter<T> nth(int i);
1207 
1214  const T& operator[](int i) const;
1215 
1216 };
1217 
1218 
1229 template <class T>
1230 class MutableList: public List<T>, public MutableCollection<T> {
1231 public:
1232 
1237  T& first(void);
1238 
1243  T& last(void);
1244 
1249  void addFirst(const T& item);
1250 
1255  void addLast(const T& item);
1256 
1260  void removeFirst(void);
1261 
1265  void removeLast(void);
1266 
1272  void addAfter(const Iter<T>& pos, const T& item);
1273 
1279  void addBefore(const Iter<T>& pos, const T& item);
1280 
1286  void removeBefore(const Iter<T>& pos);
1287 
1292  void removeAfter(const Iter<T>& pos);
1293 
1299  void set(const Iterator<T>& pos, const T& item);
1300 
1307  T& operator[](int i);
1308 
1309 };
1310 
1311 
1322 template <class T>
1323 class BiDiList: public List<T> {
1324 public:
1325 
1329  class Iterator: public List<T>::Iterator {
1330  public:
1331  Iterator(const BiDiList<T>& list);
1332  Iterator(const Iterator<T>& iter);
1333  Iterator(const BackIterator<T>& iter);
1335  };
1336 
1340  class BackIterator: public Iterator<T> {
1341  public:
1342  BackIterator(const BiDiList<T>& list);
1344  BackIterator(const Iterator<T>& iter);
1347  };
1348 };
1349 
1350 
1361 template <class K, class T>
1362 class Key {
1363 public:
1364 
1368  typedef K key_t;
1369 
1375  static const K& key(const T& value);
1376 };
1377 
1378 
1388 template <class T>
1389 class Compare {
1390 public:
1391  int compare(T v1, T v2);
1392 };
1393 
1394 
1402 template <class T>
1403 class Predicate {
1404 public:
1405 
1411  bool test(const T& item);
1412 };
1413 
1414 } } // elm::concept
elm::concept::Hash
Definition: concepts.h:836
elm::StackAllocator::chunkFilled
virtual void * chunkFilled(t::size size)
Definition: alloc_StackAllocator.cpp:92
elm::concept::MutableCollection::operator-=
MutableCollection< T > & operator-=(const T &item)
elm::concept::Set::operator+=
Set< T > operator+=(const Set< T > set)
elm::avl::AbstractTree::insert
void insert(Stack &stack, Node *node)
Definition: avl_GenTree.cpp:256
elm::inhstruct::DLList::first
DLNode * first(void) const
Definition: DLList.h:93
elm::concept::Map::PairIterator
Definition: concepts.h:1079
elm::Option
Definition: Option.h:35
elm::ListGC::enable
void enable() override
Definition: alloc_ListGC.cpp:136
elm::concept::List::first
const T & first(void) const
elm::MessageException
Definition: MessageException.h:30
elm::concept::Set::insert
void insert(const T &item)
elm::concept::MutableCollection::clear
void clear(void)
elm::List::add
void add(const T &value)
Definition: List.h:131
elm::concept::Set::operator&
Set< T > operator&(const Set &set)
elm::Temp
Definition: SimpleGC.h:34
elm::concept::MutableList::removeBefore
void removeBefore(const Iter< T > &pos)
elm::concept::MutableCollection::copy
void copy(const Collection< T > &items)
elm::checksum::MD5::print
void print(io::Output &out)
Definition: checksum_MD5.cpp:328
elm::concept::List::last
const T & last(void) const
elm::avl::AbstractTree::exchange
void exchange(Node *n, Node *m)
Definition: avl_GenTree.cpp:195
elm::io::width
IntFormat width(int width, IntFormat fmt)
Definition: Output.h:261
elm::t::out
typename type_info< T >::out_t out
Definition: type_info.h:284
elm::DefaultAllocator::allocate
void * allocate(t::size size)
Definition: alloc_DefaultAllocator.cpp:131
elm::concept::MutableMap::removeByKey
void removeByKey(const K &key)
elm::concept::MutableList::addBefore
void addBefore(const Iter< T > &pos, const T &item)
elm::concept::MutableCollection
Definition: concepts.h:348
elm::inhstruct::DLNode::atEnd
bool atEnd(void) const
Definition: DLList.h:37
elm::StackAllocator::chunk_t::buffer
char buffer[0]
Definition: StackAllocator.h:58
elm::concept::MutableIter::equals
bool equals(const MutableIter &iterator) const
elm::io::RIGHT
@ RIGHT
Definition: Output.h:45
elm::String::chars
const char * chars(void) const
Definition: String.h:76
elm::concept::ExpandableArray::insert
void insert(int index, const T &item)
elm::iter
Definition: util_WAHVector.cpp:157
elm::avl::dump
static void dump(Tree::Node *node, int tab=0)
Definition: avl_Tree.cpp:64
elm::ListGC::~ListGC
~ListGC()
Definition: alloc_ListGC.cpp:76
elm::avl::AbstractTree::Node
Definition: GenTree.h:54
elm::checksum::Fletcher::sum
t::uint32 sum(void)
Definition: checksum_Fletcher.cpp:100
elm::concept::Queue::reset
void reset(void)
elm::io::p
Printable< T, M > p(const T &data, const M &man)
Definition: Output.h:302
elm::concept::Set::operator<=
bool operator<=(const Set &coll)
elm::concept::MutableCollection::add
void add(const T &item)
elm::checksum::Fletcher::flush
virtual int flush(void)
Definition: checksum_Fletcher.cpp:150
elm::inhstruct::DLList::addFirst
void addFirst(DLNode *node)
Definition: DLList.h:106
elm::concept::BiDiList
Definition: concepts.h:1323
elm::GCManager
Definition: AbstractGC.h:31
elm::concept::Stack::isEmpty
bool isEmpty(void) const
DLList
elm::AbstractBlockAllocatorWithGC::free_list
free_t * free_list
Definition: BlockAllocatorWithGC.h:62
elm::Vector::count
int count(void) const
Definition: Vector.h:81
elm::GroupedGC::mark
virtual bool mark(void *data, t::size size)
Definition: alloc_GroupedGC.cpp:352
elm::AbstractGC::~AbstractGC
virtual ~AbstractGC()
Definition: alloc_AbstractGC.cpp:90
elm::concept::PartialComparator::GREATER
static const int GREATER
Definition: concepts.h:976
elm::concept::Set
Definition: concepts.h:443
elm::concept::Stack::reset
void reset(void)
elm::concept::Set::operator|=
Set< T > operator|=(const Set< T > set)
elm::concept::Iter::item
T item(void)
elm::concept::Hash::isEqual
bool isEqual(const T &object1, const T &object2)
elm::concept::ExpandableArray::shrink
void shrink(int length)
elm::concept::Allocator
Definition: alloc_DefaultAllocator.cpp:77
elm::concept::MutableCollection::addAll
void addAll(const Collection< T > &items)
elm::io::LEFT
@ LEFT
Definition: Output.h:43
elm::concept::MutableMap::clear
void clear()
elm::avl::AbstractTree::Node::_right
Node * _right
Definition: GenTree.h:57
elm::ListGC::block_t::free
void free()
Definition: alloc_ListGC.cpp:46
elm::concept::MutableList::last
T & last(void)
elm::AbstractGC
Definition: AbstractGC.h:38
elm::concept::Set::meet
void meet(const Set< T > &set)
elm::concept::Set::operator|
Set< T > operator|(const Set &set)
elm::t::uint16
unsigned short uint16
Definition: arch.h:29
elm::AbstractBlockAllocatorWithGC::free_t::next
free_t * next
Definition: BlockAllocatorWithGC.h:61
elm::concept::MutableCollection::removeAll
void removeAll(const Collection< T > &items)
elm::concept::Set::operator-=
Set< T > operator-=(const Set< T > set)
elm::StaticStack::isEmpty
bool isEmpty(void) const
Definition: StaticStack.h:41
elm::GCManager::clean
virtual void clean(void *p)
Definition: alloc_AbstractGC.cpp:54
elm::concept::MutableMap::put
void put(const K &key, const T &value)
ones
Definition: ones.py:1
elm::concept::Collection
Definition: concepts.h:228
elm::concept::MutableIter::next
void next(void)
elm::avl::AbstractTree::leftMost
Node * leftMost(Stack &s, Node *n)
Definition: avl_GenTree.cpp:443
elm::concept::Map::keys
Iterable< KeyIter > keys() const
elm::SimpleGC::doGC
void doGC(void)
Definition: alloc_SimpleGC.cpp:121
elm::concept::PartialComparator::lessThan
static bool lessThan(const T &v1, const T &v2)
elm::concept::Equiv::equals
static bool equals(const T &val1, const T &val2)
elm::concept::MutableMap
Definition: concepts.h:1121
elm::concept::Collection::contains
bool contains(const T &item)
elm::concept::MutableIter::operator=
MutableIter & operator=(const MutableIter &iterator)
elm::max
const T & max(const T &x, const T &y)
Definition: compare.h:108
elm::StackAllocator::allocate
void * allocate()
Definition: StackAllocator.h:40
elm::io::NONE
@ NONE
Definition: Output.h:42
elm::AbstractBlockAllocatorWithGC::allocate
void * allocate(void)
Definition: alloc_BlockAllocatorWithGC.cpp:69
elm::concept::MutableList::addLast
void addLast(const T &item)
elm::concept::Collection::Iter::Iter
Iter(const Collection< T > &collection)
elm::checksum::MD5::digest_t
unsigned char digest_t[16]
Definition: MD5.h:36
elm::concept::PartialComparator::EQUAL
static const int EQUAL
Definition: concepts.h:966
elm::checksum::MD5::flush
virtual int flush(void)
Definition: checksum_MD5.cpp:403
elm::concept::PartialComparator::equals
static bool equals(const T &v1, const T &v2)
elm::ListGC::block_t
Definition: alloc_ListGC.cpp:38
elm::AbstractBlockAllocatorWithGC::free
void free(void *block)
Definition: alloc_BlockAllocatorWithGC.cpp:117
elm::concept::MutableIter::operator++
MutableIter & operator++(int)
elm::ListGC::block_t::mark
void mark()
Definition: alloc_ListGC.cpp:55
elm::Flags::clear
void clear(int i)
Definition: Flags.h:34
elm::io::bin
IntFormat bin(IntFormat fmt)
Definition: Output.h:257
elm::SimpleGC::SimpleGC
SimpleGC(t::size size=4096)
Definition: alloc_SimpleGC.cpp:84
elm::ListGC::block_t::next
block_t * next
Definition: alloc_ListGC.cpp:58
elm::StaticStack::pop
const T & pop(void)
Definition: StaticStack.h:43
elm::concept::Comparator
Definition: concepts.h:893
elm::concept::Key
Definition: concepts.h:1362
elm::avl::Tree::get
Node * get(Node *node)
Definition: avl_Tree.cpp:123
elm::concept::BiDiList::BackIterator
Definition: concepts.h:1340
elm::avl::AbstractTree::Node::_left
Node * _left
Definition: GenTree.h:57
elm::GroupedGC::clear
void clear(void)
Definition: alloc_GroupedGC.cpp:171
elm::concept::Collection::operator==
bool operator==(const Collection &coll)
elm::concept::Array::operator[]
const T & operator[](int index) const
elm::GroupedGC::allocate
virtual void * allocate(t::size size)
Definition: alloc_GroupedGC.cpp:276
elm::BadAlloc
Definition: DefaultAllocator.h:32
elm::concept::Iter::equals
bool equals(const Iter &iterator) const
elm::concept::Collection::t
T t
Definition: concepts.h:234
elm::concept::MutableCollection::operator=
MutableCollection & operator=(const Collection< T > &c)
elm::cout
io::Output cout
elm::concept::List::find
Iter< T > find(const T &item)
elm::io::BlockInStream
Definition: BlockInStream.h:31
value
elm::checksum::Fletcher::write
virtual int write(const char *buffer, int size)
Definition: checksum_Fletcher.cpp:142
elm::AbstractBlockAllocatorWithGC::destroy
virtual void destroy(void *p)
Definition: alloc_BlockAllocatorWithGC.cpp:236
elm::concept::MutableList::addAfter
void addAfter(const Iter< T > &pos, const T &item)
elm::concept::Collection::count
int count(void)
elm::Iterable
Definition: util.h:220
bool
elm::concept::Map::KeyIter::KeyIter
KeyIter(const Map< K, T > &map)
elm::concept::Map::KeyIter
Definition: concepts.h:1055
elm::concept::List::nth
Iter< T > nth(int i)
elm::concept::Set::operator+
Set< T > operator+(const Set &set)
elm::map
void map(const C &c, const F &f, D &d)
Definition: util.h:89
elm::CString
Definition: CString.h:17
elm::ListGC::runGC
void runGC() override
Definition: alloc_ListGC.cpp:95
elm::io::pad
IntFormat pad(char pad, IntFormat fmt)
Definition: Output.h:266
ones.ones
def ones(v)
Definition: ones.py:3
elm::min
const T & min(const T &x, const T &y)
Definition: compare.h:104
elm::concept::Predicate
Definition: concepts.h:1403
elm::concept::Map::get
Option< const T & > get(const K &key) const
elm::concept::MutableIter
Definition: concepts.h:152
elm::concept::MutableArray::shrink
void shrink(int length)
elm::concept::PartialComparator::LESS
static const int LESS
Definition: concepts.h:971
elm::concept::BiDiList::BackIterator::operator=
BackIterator & operator=(const BackIterator< T > &iter)
elm::concept::Map::PairIterator::PairIterator
PairIterator(const Map< K, T > &map)
elm::inhstruct::BinTree::root
Node * root(void) const
Definition: BinTree.h:90
elm::concept::PartialComparator
Definition: concepts.h:960
elm::block::DynBlock::alloc
char * alloc(int size)
Definition: block_DynBlock.cpp:139
elm::t::in
typename type_info< T >::in_t in
Definition: type_info.h:283
elm::avl::AbstractTree::dir_t
dir_t
Definition: GenTree.h:46
elm::quicksort
void quicksort(A &array, const C &c=Comparator< typename A::t >())
Definition: quicksort.h:30
elm::concept::MutableMap::remove
void remove(const Collection< T >::Iter &iter)
elm::ListGC::block_t::block
static block_t * block(void *p)
Definition: alloc_ListGC.cpp:50
elm::avl::AbstractTree::Stack
Definition: GenTree.h:61
elm::avl::Tree::free
virtual void free(Node *node)
Definition: avl_Tree.cpp:363
elm::concept::MutableCollection::operator+=
MutableCollection< T > & operator+=(const T &item)
elm::GCManager::collect
virtual void collect(AbstractGC &gc)=0
elm::concept::Collection::Iter
Definition: concepts.h:278
elm::concept::MutableMap::operator[]
T & operator[](const K &k)
elm::type_of
const rtti::Type & type_of(void)
Definition: type_of.h:77
elm::avl::Tree::Node::_right
Node * _right(void) const
Definition: Tree.h:39
elm::_
AutoStringStartup & _
Definition: debug_CrashHandler.cpp:232
elm::StackAllocator::chunk_t
Definition: StackAllocator.h:56
elm::concept::MutableList::first
T & first(void)
elm::concept::Collection::self_t
Collection< T > self_t
Definition: concepts.h:239
elm::AbstractBlockAllocatorWithGC::endGC
virtual void endGC(void)
Definition: alloc_BlockAllocatorWithGC.cpp:227
elm::String::length
int length(void) const
Definition: String.h:75
elm::concept::Map::operator[]
const T & operator[](const K &k) const
elm::checksum::Fletcher::Fletcher
Fletcher(void)
Definition: checksum_Fletcher.cpp:45
elm::BitVector::bit
bool bit(int i) const
Definition: BitVector.h:41
elm::block::DynBlock::put
void put(const char *block, int size)
Definition: block_DynBlock.cpp:57
elm::checksum::Fletcher::lastErrorMessage
virtual cstring lastErrorMessage(void)
Definition: checksum_Fletcher.cpp:157
elm::AbstractBlockAllocatorWithGC::free_t
Definition: BlockAllocatorWithGC.h:61
elm::checksum::Fletcher::~Fletcher
virtual ~Fletcher(void)
Definition: checksum_Fletcher.cpp:164
elm::concept::BiDiList::Iterator::Iterator
Iterator(const BiDiList< T > &list)
Char.crange
def crange(c1, c2)
Definition: Char.py:20
elm::Vector::length
int length(void) const
Definition: Vector.h:116
elm::concept::Set::operator>=
bool operator>=(const Set &coll)
elm::concept::Equiv
Definition: concepts.h:931
elm::concept::Set::operator*
Set< T > operator*(const Set &set)
elm::block::DynBlock::size
int size(void) const
Definition: DynBlock.h:21
elm::avl::Tree::Node::_left
Node * _left(void) const
Definition: Tree.h:38
elm::io::list
ListPrinter< T > list(const T &l, cstring s="", typename ListPrinter< T >::fun_t f=ListPrinter< T >::asis)
Definition: Output.h:321
elm::avl::Tree::clean
void clean(void)
Definition: Tree.h:86
elm
Definition: adapter.h:26
elm::concept::PartialComparator::UNCOMP
static const int UNCOMP
Definition: concepts.h:981
elm::stree::Tree::get
const T & get(const K &key, const T &def) const
Definition: Tree.h:57
elm::concept::List
Definition: concepts.h:1170
elm::concept::Iter::operator=
Iter & operator=(const Iter &iterator)
elm::concept::MutableList::removeLast
void removeLast(void)
elm::checksum::MD5::put
void put(const void *buffer, t::uint32 length)
Definition: checksum_MD5.cpp:125
Char.Set.name
name
Definition: Char.py:6
elm::checksum::Fletcher::put
void put(io::InStream &in)
Definition: checksum_Fletcher.cpp:78
elm::ListGC::ListGC
ListGC(GCManager &m, int limit=1024)
Definition: alloc_ListGC.cpp:66
elm::concept::Array
Definition: concepts.h:574
elm::concept::Comparator::doCompare
int doCompare(const T &object1, const T &object2)
Char.Set.set
def set(self, s)
Definition: Char.py:10
elm::AbstractGC::free
virtual void free(void *block)
Definition: alloc_AbstractGC.cpp:125
elm::concept::Key::key
static const K & key(const T &value)
elm::concept::Queue::isEmpty
bool isEmpty(void) const
elm::concept::Array::indexOf
int indexOf(const T &value, int start=0) const
elm::concept::Queue::head
const T & head(void) const
Char.Set.words
words
Definition: Char.py:7
elm::Vector::add
void add(const T &v)
Definition: Vector.h:101
FragTable
elm::concept::Set::operator*=
Set< T > operator*=(const Set< T > set)
elm::concept::MutableCollection::end
MutableIter< T > end()
elm::AbstractGC::manager
GCManager & manager
Definition: AbstractGC.h:56
elm::ListGC::clean
void clean() override
Definition: alloc_ListGC.cpp:143
elm::inhstruct::DLNode::remove
void remove(void)
Definition: DLList.h:57
elm::Vector::top
const T & top(void) const
Definition: Vector.h:170
elm::concept::MutableList::removeFirst
void removeFirst(void)
elm::avl::AbstractTree::rotateRight
void rotateRight(Stack &s)
Definition: avl_GenTree.cpp:213
elm::concept::Comparator::compare
static int compare(const T &object1, const T &object2)
elm::StackAllocator::DEFAULT
static StackAllocator DEFAULT
Definition: StackAllocator.h:36
elm::checksum::MD5::lastErrorMessage
virtual cstring lastErrorMessage(void)
Definition: checksum_MD5.cpp:410
iter
elm::concept::Collection::begin
Iter begin(void) const
elm::GroupedGC::~GroupedGC
virtual ~GroupedGC(void)
Definition: alloc_GroupedGC.cpp:164
elm::concept::Compare
Definition: concepts.h:1389
elm::concept::Map
Definition: concepts.h:1027
elm::concept::MutableList
Definition: concepts.h:1230
elm::t::size
uint64 size
Definition: arch.h:35
elm::concept::Iter::operator++
Iter & operator++(int)
elm::io::endl
const EOL endl
Definition: io_Output.cpp:880
elm::stree::Tree
Definition: Tree.h:31
elm::concept::Collection::operator!=
bool operator!=(const Collection &coll)
elm::DefaultAllocator
Definition: DefaultAllocator.h:39
elm::concept::Hash::computeHash
t::uint32 computeHash(const T &object)
elm::checksum::MD5::~MD5
virtual ~MD5(void)
Definition: checksum_MD5.cpp:114
elm::concept::Set::operator<
bool operator<(const Collection &coll)
elm::GroupedGC::collect
virtual void collect(void)
Definition: GroupedGC.h:44
Char.Set.__init__
def __init__(self, name, s="")
Definition: Char.py:5
elm::BitVector::ZeroIterator
Definition: BitVector.h:133
ValueIterator
array
elm::concept::MutableArray
Definition: concepts.h:625
SortedBinTree
elm::concept::List::operator[]
const T & operator[](int i) const
elm::avl::AbstractTree::Node::_bal
balance_t _bal
Definition: GenTree.h:58
elm::concept::MutableIter::item
T & item(void)
elm::builder
Definition: util_WAHVector.cpp:60
elm::ListGC::disable
void disable() override
Definition: alloc_ListGC.cpp:131
elm::BitVector::set
void set(int index) const
Definition: BitVector.h:60
elm::ListGC::block_t::data
void * data()
Definition: alloc_ListGC.cpp:54
elm::avl::abs
static int abs(int x)
Definition: avl_Tree.cpp:36
elm::ListGC::block_t::unmark
void unmark()
Definition: alloc_ListGC.cpp:56
elm::concept::MutableArray::set
void set(int index, const T &item)
elm::ListGC::block_t::alloc
static block_t * alloc(t::size s)
Definition: alloc_ListGC.cpp:42
elm::GroupedGC::GroupedGC
GroupedGC(t::size size=4096)
Definition: alloc_GroupedGC.cpp:62
elm::DefaultAllocator::DEFAULT
static DefaultAllocator DEFAULT
Definition: DefaultAllocator.h:41
elm::concept::Collection::end
Iter end(void) const
elm::BadAlloc::~BadAlloc
virtual ~BadAlloc(void)
Definition: alloc_DefaultAllocator.cpp:104
elm::concept::Stack::push
void push(const T &item)
elm::concept::Stack
Definition: concepts.h:729
elm::Path
elm::sys::Path Path
Definition: Path.h:188
elm::GroupedGC::endGC
virtual void endGC(void)
Definition: alloc_GroupedGC.cpp:413
elm::concept::Set::diff
void diff(const Set< T > &set)
elm::SimpleGC::endGC
virtual void endGC(void)
Definition: alloc_SimpleGC.cpp:231
elm::concept::Collection::isEmpty
bool isEmpty(void)
elm::t::uint8
unsigned char uint8
Definition: arch.h:27
elm::AbstractBlockAllocatorWithGC::~AbstractBlockAllocatorWithGC
virtual ~AbstractBlockAllocatorWithGC(void)
Definition: alloc_BlockAllocatorWithGC.cpp:48
elm::GCManager::~GCManager
virtual ~GCManager()
Definition: alloc_AbstractGC.cpp:37
elm::AbstractBlockAllocatorWithGC::collect
virtual void collect(void)=0
elm::cerr
io::Output cerr
elm::block::DynBlock::get
void get(char *block, int size, int pos)
Definition: block_DynBlock.cpp:77
elm::StackAllocator::clear
void clear(void)
Definition: alloc_StackAllocator.cpp:109
elm::AbstractBlockAllocatorWithGC::AbstractBlockAllocatorWithGC
AbstractBlockAllocatorWithGC(t::size block_size, t::size chunk_size=1<< 20)
Definition: alloc_BlockAllocatorWithGC.cpp:37
elm::concept::BiDiList::BackIterator::BackIterator
BackIterator(const BiDiList< T > &list)
elm::concept::MutableCollection::begin
MutableIter< T > begin()
elm::concept::BiDiList::Iterator::operator=
Iterator & operator=(const BackIterator< T > &iter)
elm::AbstractBlockAllocatorWithGC::free_cnt
int free_cnt
Definition: BlockAllocatorWithGC.h:63
elm::SimpleGC
Definition: SimpleGC.h:58
elm::concept::Queue
Definition: concepts.h:784
elm::concept::Hash::hash
static t::uint32 hash(const T &object)
elm::concept::Set::join
void join(const Set< T > &set)
elm::t::uint32
unsigned int uint32
Definition: arch.h:31
elm::stree::SegmentBuilder
Definition: SegmentBuilder.h:30
elm::concept::Iter
Definition: concepts.h:75
Char.Set
Definition: Char.py:3
elm::concept::PartialComparator::compare
static int compare(const T &v1, const T &v2)
elm::GroupedGC::beginGC
virtual void beginGC(void)
Definition: alloc_GroupedGC.cpp:385
elm::concept::Hash::equals
static bool equals(const T &object1, const T &object2)
elm::StackAllocator::mark_t
char * mark_t
Definition: StackAllocator.h:45
elm::StackAllocator::mark
mark_t mark(void)
Definition: alloc_StackAllocator.cpp:142
elm::avl::Tree::compare
virtual int compare(Node *node1, Node *node2)=0
elm::concept::BiDiList::Iterator
Definition: concepts.h:1329
elm::concept::MutableList::removeAfter
void removeAfter(const Iter< T > &pos)
elm::String
Definition: String.h:30
elm::concept::MutableCollection::remove
void remove(const T &item)
elm::Temp::~Temp
virtual ~Temp(void)
Definition: alloc_SimpleGC.cpp:46
elm::concept::Equiv::isEqual
static bool isEqual(const T &val1, const T &val2)
elm::avl::Tree::Node
Definition: Tree.h:34
elm::avl::AbstractTree::remove
void remove(Stack &stack, Node *n)
Definition: avl_GenTree.cpp:318
elm::io::IOException
Definition: IOException.h:29
elm::avl::AbstractTree::Stack::topDir
dir_t topDir(void) const
Definition: GenTree.h:66
elm::ListGC::block_t::isMarked
bool isMarked() const
Definition: alloc_ListGC.cpp:57
elm::hash
t::hash hash(const T &x)
Definition: hash.h:155
elm::concept::Predicate::test
bool test(const T &item)
elm::DefaultAllocator::mark
virtual bool mark(void *data, t::size size)
Definition: alloc_DefaultAllocator.cpp:148
elm::concept::MutableIter::operator!=
bool operator!=(const MutableIter &iterator) const
elm::concept::MutableList::operator[]
T & operator[](int i)
elm::concept::Compare::compare
int compare(T v1, T v2)
elm::concept::Iter::ended
bool ended(void)
elm::avl::AbstractTree::rotateLeft
void rotateLeft(Stack &s)
Definition: avl_GenTree.cpp:234
elm::checksum::MD5::digest
void digest(digest_t tab)
Definition: checksum_MD5.cpp:318
elm::concept::MutableArray::get
T & get(int index)
elm::SimpleGC::mark
bool mark(void *data, t::size size)
Definition: alloc_SimpleGC.cpp:182
elm::StackAllocator::newChunk
void newChunk(void)
Definition: alloc_StackAllocator.cpp:121
elm::concept::Stack::top
const T & top(void) const
elm::concept::Collection::containsAll
bool containsAll(const C< T > &collection)
elm::t::ptr
void * ptr
Definition: types.h:30
elm::concept::Set::operator>
bool operator>(const Set &coll)
elm::concept::Set::operator&=
Set< T > operator&=(const Set< T > set)
elm::SimpleGC::collect
virtual void collect(void)=0
elm::BadAlloc::message
virtual String message(void)
Definition: alloc_DefaultAllocator.cpp:109
Char
Definition: Char.py:1
elm::AbstractBlockAllocatorWithGC::totalCount
int totalCount(void) const
Definition: alloc_BlockAllocatorWithGC.cpp:244
elm::ListGC::mark
bool mark(void *data, t::size size) override
Definition: alloc_ListGC.cpp:123
elm::concept::Queue::put
void put(const T &item)
elm::avl::AbstractTree::Stack::push
void push(Node *node, dir_t dir)
Definition: GenTree.h:64
elm::str
string str(const char *s)
Definition: String.h:150
elm::SimpleGC::~SimpleGC
virtual ~SimpleGC(void)
Definition: alloc_SimpleGC.cpp:105
elm::BitVector
Definition: BitVector.h:31
elm::SimpleGC::clear
void clear(void)
Definition: alloc_SimpleGC.cpp:112
elm::io::right
IntFormat right(IntFormat fmt)
Definition: Output.h:264
elm::ListGC::block_t::TAG
static const t::intptr TAG
Definition: alloc_ListGC.cpp:40
elm::concept::ExpandableArray
Definition: concepts.h:675
elm::concept::Iter::operator!=
bool operator!=(const Iter &iterator) const
elm::Flags::set
void set(int i)
Definition: Flags.h:33
elm::io::hex
IntFormat hex(IntFormat fmt)
Definition: Output.h:259
elm::concept::Iter::operator==
bool operator==(const Iter &iterator) const
elm::concept::Stack::pop
T pop(void)
elm::io::left
IntFormat left(IntFormat fmt)
Definition: Output.h:263
elm::concept::Collection::equals
bool equals(const Collection &coll)
elm::concept::MutableArray::operator[]
T & operator[](int index)
elm::Temp::Temp
Temp(SimpleGC &gc)
Definition: alloc_SimpleGC.cpp:40
elm::SimpleGC::allocate
void * allocate(t::size size)
Definition: alloc_SimpleGC.cpp:152
Vector
elm::concept::MutableIter::ended
bool ended(void)
elm::concept::PartialComparator::greaterThan
static bool greaterThan(const T &v1, const T &v2)
elm::AbstractBlockAllocatorWithGC::mark
bool mark(void *ptr)
Definition: alloc_BlockAllocatorWithGC.cpp:191
elm::concept::MutableIter::operator==
bool operator==(const MutableIter &iterator) const
elm::concept::Array::length
int length(void)
elm::concept::Map::hasKey
bool hasKey(const K &key) const
elm::SimpleGC::beginGC
virtual void beginGC(void)
Definition: alloc_SimpleGC.cpp:205
elm::concept::Key::key_t
K key_t
Definition: concepts.h:1368
elm::concept::Set::subsetOf
bool subsetOf(const Set &coll)
elm::StackAllocator::~StackAllocator
virtual ~StackAllocator(void)
Definition: alloc_StackAllocator.cpp:63
elm::io::Output
Definition: Output.h:179
elm::GroupedGC::doGC
void doGC(void)
Definition: alloc_GroupedGC.cpp:180
elm::StackAllocator::release
void release(mark_t mark)
Definition: alloc_StackAllocator.cpp:151
elm::StackAllocator::chunk_t::next
struct chunk_t * next
Definition: StackAllocator.h:57
elm::ListGC::allocate
void * allocate(t::size size) override
Definition: alloc_ListGC.cpp:81
elm::concept::Array::get
const T & get(int index) const
elm::avl::AbstractTree::Stack::topNode
Node * topNode(void) const
Definition: GenTree.h:67
elm::checksum::MD5::MD5
MD5(void)
Definition: checksum_MD5.cpp:99
elm::avl::AbstractTree::link
Node ** link(const Stack &s)
Definition: avl_GenTree.cpp:180
elm::inhstruct::DLNode
Definition: DLList.h:30
elm::concept::Array::lastIndexOf
int lastIndexOf(const T &value, int start=-1) const
Iterator
elm::concept::MutableList::set
void set(const Iterator< T > &pos, const T &item)
elm::AbstractBlockAllocatorWithGC::collectGarbage
void collectGarbage(void)
Definition: alloc_BlockAllocatorWithGC.cpp:124
elm::t::intptr
uint64 intptr
Definition: arch.h:38
elm::concept::Map::pairs
Iterable< PairIter > pairs() const
elm::concept::Set::operator-
Set< T > operator-(const Set &set)
elm::t::offset
uint64 offset
Definition: arch.h:36
elm::AbstractBlockAllocatorWithGC::beginGC
virtual void beginGC(void)
Definition: alloc_BlockAllocatorWithGC.cpp:218
elm::concept::MutableList::addFirst
void addFirst(const T &item)
elm::concept::Queue::get
T get(void)
elm::StackAllocator::StackAllocator
StackAllocator(t::size size=4096)
Definition: alloc_StackAllocator.cpp:55
elm::concept::ExpandableArray::removeAt
void removeAt(int index)
elm::inhstruct::BinTree::setRoot
void setRoot(Node *node)
Definition: BinTree.h:93
elm::checksum::MD5::write
virtual int write(const char *buffer, int size)
Definition: checksum_MD5.cpp:395
elm::concept::Iter::next
void next(void)
elm::io::InStream
Definition: InStream.h:29
Char.Set.dump
def dump(self)
Definition: Char.py:15