22 #ifndef INCLUDED_PMT_INT_H
23 #define INCLUDED_PMT_INT_H
26 #include <boost/utility.hpp>
27 #include <boost/detail/atomic_count.hpp>
35 #define PMT_LOCAL_ALLOCATOR 0 // define to 0 or 1
39 mutable boost::detail::atomic_count count_;
46 virtual bool is_bool()
const {
return false; }
51 virtual bool is_real()
const {
return false; }
53 virtual bool is_null()
const {
return false; }
54 virtual bool is_pair()
const {
return false; }
55 virtual bool is_tuple()
const {
return false; }
57 virtual bool is_dict()
const {
return false; }
58 virtual bool is_any()
const {
return false; }
77 # if (PMT_LOCAL_ALLOCATOR)
78 void *
operator new(size_t);
79 void operator delete(
void *, size_t);
103 const std::string
name() {
return d_name; }
189 std::vector<pmt_t> d_v;
199 size_t length()
const {
return d_v.size(); }
206 std::vector<pmt_t> d_v;
214 size_t length()
const {
return d_v.size(); }
225 pmt_any(
const boost::any &any);
229 const boost::any &
ref()
const {
return d_any; }
230 void set(
const boost::any &any) { d_any = any; }
240 virtual size_t length()
const = 0;
243 #include "pmt_unv_int.h"
#define GRUEL_API
Definition: gruel/src/include/gruel/api.h:30
virtual bool is_s64vector() const
Definition: pmt_int.h:68
pmt_t car() const
Definition: pmt_int.h:180
virtual bool is_u8vector() const
Definition: pmt_int.h:61
size_t length() const
Definition: pmt_int.h:199
bool is_uint64() const
Definition: pmt_int.h:131
pmt_t _ref(size_t k) const
Definition: pmt_int.h:216
virtual bool is_any() const
Definition: pmt_int.h:58
bool is_tuple() const
Definition: pmt_int.h:212
pmt_t d_cdr
Definition: pmt_int.h:174
pmt_vector(size_t len, pmt_t fill)
pmt_t d_car
Definition: pmt_int.h:173
bool is_complex() const
Definition: pmt_int.h:157
uint64_t value() const
Definition: pmt_int.h:132
virtual bool is_uniform_vector() const
Definition: pmt_int.h:60
pmt_pair(const pmt_t &car, const pmt_t &cdr)
bool is_real() const
Definition: pmt_int.h:144
virtual bool is_s16vector() const
Definition: pmt_int.h:64
std::complex< double > value() const
Definition: pmt_int.h:158
void set_cdr(pmt_t cdr)
Definition: pmt_int.h:184
pmt_uint64(uint64_t value)
Definition: pmt_int.h:122
pmt_t next()
Definition: pmt_int.h:105
pmt_base()
Definition: pmt_int.h:42
pmt_complex(std::complex< double > value)
virtual bool is_bool() const
Definition: pmt_int.h:46
virtual bool is_uint64() const
Definition: pmt_int.h:50
double value() const
Definition: pmt_int.h:145
bool is_number() const
Definition: pmt_int.h:130
virtual bool is_dict() const
Definition: pmt_int.h:57
virtual bool is_s8vector() const
Definition: pmt_int.h:62
Definition: pmt_int.h:170
virtual bool is_f64vector() const
Definition: pmt_int.h:70
bool is_number() const
Definition: pmt_int.h:156
virtual bool is_real() const
Definition: pmt_int.h:51
virtual bool is_null() const
Definition: pmt_int.h:53
uint64_t d_value
Definition: pmt_int.h:125
virtual bool is_complex() const
Definition: pmt_int.h:52
bool is_integer() const
Definition: pmt_int.h:118
virtual bool is_u16vector() const
Definition: pmt_int.h:63
const boost::any & ref() const
Definition: pmt_int.h:229
pmt_t _ref(size_t k) const
Definition: pmt_int.h:201
pmt_t ref(size_t k) const
virtual bool is_s32vector() const
Definition: pmt_int.h:66
void set(const boost::any &any)
Definition: pmt_int.h:230
double d_value
Definition: pmt_int.h:138
std::complex< double > d_value
Definition: pmt_int.h:151
unsigned __int64 uint64_t
Definition: stdint.h:90
void set_next(pmt_t next)
Definition: pmt_int.h:106
Definition: pmt_int.h:161
bool is_symbol() const
Definition: pmt_int.h:102
bool is_number() const
Definition: pmt_int.h:117
bool is_null() const
Definition: pmt_int.h:167
pmt_any(const boost::any &any)
virtual bool is_c64vector() const
Definition: pmt_int.h:72
void set(size_t k, pmt_t obj)
virtual bool is_vector() const
Definition: pmt_int.h:56
virtual bool is_symbol() const
Definition: pmt_int.h:47
Definition: pmt_int.h:148
virtual bool is_u32vector() const
Definition: pmt_int.h:65
Definition: pmt_int.h:135
virtual bool is_f32vector() const
Definition: pmt_int.h:69
pmt_t ref(size_t k) const
virtual bool is_tuple() const
Definition: pmt_int.h:55
long value() const
Definition: pmt_int.h:119
Definition: pmt_int.h:109
pmt_t cdr() const
Definition: pmt_int.h:181
size_t length() const
Definition: pmt_int.h:214
bool is_bool() const
Definition: pmt_int.h:89
virtual bool is_u64vector() const
Definition: pmt_int.h:67
GRUEL_API void intrusive_ptr_release(pmt_base *)
bool is_vector() const
Definition: pmt_int.h:195
GRUEL_API void intrusive_ptr_add_ref(pmt_base *)
bool is_any() const
Definition: pmt_int.h:228
virtual bool is_pair() const
Definition: pmt_int.h:54
Definition: pmt_int.h:204
boost::intrusive_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting). See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
Definition: pmt.h:54
bool is_number() const
Definition: pmt_int.h:143
virtual bool is_number() const
Definition: pmt_int.h:48
Definition: pmt_int.h:220
pmt_symbol(const std::string &name)
bool is_pair() const
Definition: pmt_int.h:179
virtual bool is_integer() const
Definition: pmt_int.h:49
void _set(size_t k, pmt_t v)
Definition: pmt_int.h:217
virtual bool is_c32vector() const
Definition: pmt_int.h:71
long d_value
Definition: pmt_int.h:112
const std::string name()
Definition: pmt_int.h:103
Definition: pmt_int.h:187
void set_car(pmt_t car)
Definition: pmt_int.h:183