diff options
author | Morgan Deters <mdeters@gmail.com> | 2010-10-12 20:20:24 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2010-10-12 20:20:24 +0000 |
commit | 2bc4c351bbf89103577fa9f33ebb395f5d61826a (patch) | |
tree | 37345ddbee75fc7405868afd3de8b7c2ffdd0fdc /src/context/cdlist_forward.h | |
parent | ec320b78deaaf31bdae1b8b048f66cfb1b3a4197 (diff) |
Merge from cc-memout branch. Here are the main points
* Add ContextMemoryAllocator<T> allocator type, conforming to
STL allocator requirements.
* Extend the CDList<> template to take an allocator (defaults
to std::allocator<T>).
* Add a specialized version of the CDList<> template (in
src/context/cdlist_context_memory.h) that allocates a list
in segments, in context memory.
* Add "forward" headers -- cdlist_forward.h, cdmap_forward.h,
and cdset_forward.h. Use these in public headers, and other
places where you don't need the full header (just the
forward-declaration). These types justify their own header
(instead of just forward-declaring yourself), because they
are complex templated types, with default template parameters,
specializations, etc.
* theory_engine.h no longer depends on individual theory headers.
(Instead it forward-declares Theory implementations.) This is
especially important now that theory .cpp files depend on
TheoryEngine (to implement Theory::getValue()). Previously,
any modification to any theory header file required *all*
theories, and the engine, to be completely rebuilt.
* Support memory cleanup for nontrivial CONSTANT kinds. This
resolves an issue with arithmetic where memory leaked for
each distinct Rational or Integer that was wrapped in a Node.
Diffstat (limited to 'src/context/cdlist_forward.h')
-rw-r--r-- | src/context/cdlist_forward.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/context/cdlist_forward.h b/src/context/cdlist_forward.h new file mode 100644 index 000000000..82bc9cc15 --- /dev/null +++ b/src/context/cdlist_forward.h @@ -0,0 +1,56 @@ +/********************* */ +/*! \file cdlist_forward.h + ** \verbatim + ** Original author: mdeters + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Courant Institute of Mathematical Sciences + ** New York University + ** See the file COPYING in the top-level source directory for licensing + ** information.\endverbatim + ** + ** \brief This is a forward declaration header to declare the + ** CDList<> template + ** + ** This is a forward declaration header to declare the CDList<> + ** template. It's useful if you want to forward-declare CDList<> + ** without including the full cdlist.h or cdlist_context_memory.h + ** header, for example, in a public header context, or to keep + ** compile times low when only a forward declaration is needed. + ** + ** Note that all specializations of the template should be listed + ** here as well, since different specializations are defined in + ** different headers (cdlist.h and cdlist_context_memory.h). + ** Explicitly declaring both specializations here ensure that if you + ** define one, you'll get an error if you didn't include the correct + ** header (avoiding different, incompatible instantiations in + ** different compilation units). + **/ + +#include "cvc4_public.h" + +#ifndef __CVC4__CONTEXT__CDLIST_FORWARD_H +#define __CVC4__CONTEXT__CDLIST_FORWARD_H + +#include <memory> + +namespace __gnu_cxx { + template <class Key> class hash; +}/* __gnu_cxx namespace */ + +namespace CVC4 { + namespace context { + template <class T> + class ContextMemoryAllocator; + + template <class T, class Allocator = std::allocator<T> > + class CDList; + + template <class T> + class CDList<T, ContextMemoryAllocator<T> >; + }/* CVC4::context namespace */ +}/* CVC4 namespace */ + +#endif /* __CVC4__CONTEXT__CDLIST_FORWARD_H */ |