lang/c/msgpack: reimplemented C++ binding with template-based static resolution design

git-svn-id: file:///Users/frsyuki/project/msgpack-git/svn/x@67 5a5092ae-2292-43ba-b2d5-dcab9c1a2731
This commit is contained in:
frsyuki
2009-02-15 09:09:58 +00:00
parent 1222466a1c
commit 9923cf4daf
26 changed files with 1338 additions and 1116 deletions

View File

@@ -40,7 +40,7 @@ struct unpack_error : public std::runtime_error {
class unpacker {
public:
unpacker();
unpacker(zone& z);
~unpacker();
public:
@@ -60,13 +60,8 @@ public:
/*! 5.1. if execute() returns true, take out the parsed object */
object data();
/*! 5.2. the parsed object is valid until the zone is deleted */
// Note that once release_zone() from unpacker, you must delete it
// otherwise the memrory will leak.
zone* release_zone();
/*! 5.3. after release_zone(), re-initialize unpacker */
void reset();
/*! 5.2. re-initialize unpacker with next zone */
void reset(zone& z);
public:
// These functions are usable when non-MessagePack message follows after
@@ -85,8 +80,6 @@ public:
void remove_nonparsed_buffer();
private:
zone* m_zone;
struct context;
context* m_ctx;
@@ -94,9 +87,12 @@ private:
size_t m_used;
size_t m_free;
size_t m_off;
private:
void expand_buffer(size_t len);
private:
unpacker();
unpacker(const unpacker&);
public: