Finished the job of splitting Narya into submodules.

The ActionScript code is now under aslib and is built via Maven (and Ant). The
CPP code is under cpplib and is ignored by everything (other than service
generation), but now at least it's not crufting up the Java submodule with its
XCode project.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6783 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2012-02-14 19:11:33 +00:00
parent 20074741b0
commit 1c311431ad
336 changed files with 113 additions and 51 deletions
@@ -0,0 +1,34 @@
#pragma once
#include "presents/Streamer.h"
#include "presents/Streamable.h"
template <typename T>
class StreamableStreamer : public Streamer
{
public:
Shared<void> createObject (ObjectInputStream& in)
{
Shared<Streamable> streamable(new T());
streamable->readObject(in);
return streamable;
}
void writeObject (const Shared<void>& object, ObjectOutputStream& out)
{
((Shared<T>&)object)->writeObject(out);
}
};
#define DECLARE_STREAMABLE() \
static const utf8& javaName (); \
static void registerWithPresents () { javaName(); } \
virtual const utf8& getJavaClassName () const { return javaName(); }
#define DEFINE_STREAMABLE(nameString, StreamableClass) \
static const utf8& gStreamableClassRegistration = StreamableClass::javaName(); \
const utf8& StreamableClass::javaName () {\
static const utf8 JAVA_NAME = nameString; \
static bool gRegistered = false; \
if (!gRegistered) { registerStreamer(JAVA_NAME, new StreamableStreamer<StreamableClass>()); gRegistered = true; } \
return JAVA_NAME; }