@@ -51,17 +51,22 @@ namespace Core
template <class T> class Shared;
template <class T> class Weak;

/*! @brief Core Serializable Interface */
/*!
* @brief Serializable Interface
*/
struct ISerializable
{
virtual ~ISerializable(void) {};

/*! @brief Serialization feature
* @param node XML node
/*!
* @brief Serialization feature
* @param node XML node
*/
virtual bool serialize(XMLElement &node) const = 0;
/*! @brief Deserialization feature
* @param node XML node

/*!
* @brief Deserialization feature
* @param node XML node
*/
virtual bool deserialize(XMLElement &node) = 0;
};
@@ -47,12 +47,16 @@ namespace Core
template <class T> class Shared;
template <class T> class Weak;

/*! @brief Core Updateable Interface */
/*!
* @brief Updateable Interface
*/
struct IUpdateable
{
virtual ~IUpdateable(void) {};

/*! @brief Update feature */
/*!
* @brief Update feature
*/
virtual void update(float delta) = 0;
};
typedef Shared<IUpdateable> SharedUpdateable;
@@ -50,45 +50,43 @@ struct TimeData;

namespace Core
{
/*! @brief Core Platform Interface */
/*!
* @brief A collection of platform-specific methods
*/
namespace Platform
{
/*!
* @brief Platform specific initialization
*/
MARSHMALLOW_CORE_EXPORT
void Initialize(void);

/*!
* @brief Platform specific finalization
*/
MARSHMALLOW_CORE_EXPORT
void Finalize(void);

/****************************************************** time */

/*!
* @brief Sleep in milliseconds
* Call the platform specific sleep function
*
* @param timeout Timeout in milliseconds
*/
MARSHMALLOW_CORE_EXPORT
void Sleep(MMTIME timeout);

/*!
* @brief Start system time
* Returns the engine start system time
*/
MARSHMALLOW_CORE_EXPORT
time_t StartTime(void);

/*!
* @brief Milliseconds since StartTime()
* Returns Milliseconds since engine was started (StartTime())
*/
MARSHMALLOW_CORE_EXPORT
MMTIME TimeStamp(void);

/*!
* @brief Reinterpret an internal timestamp
* @return Internal timestamp in system timestamp and string
* formats.
* Reinterprets an internal timestamp into TimeData
*
* @param timestamp Internal timestamp
*/
MARSHMALLOW_CORE_EXPORT
TimeData TimeStampToTimeData(MMTIME timestamp);
@@ -100,7 +98,10 @@ namespace Core
}
}

/*! @brief Time Data Struct */
/*!
* The TimeData structure contains a reinterpreted internal time stamp as both
* system time and a string
*/
struct TimeData
{
char string[21];
@@ -49,16 +49,17 @@ namespace Core
{
template <class T> class Weak;

//! @cond
struct MARSHMALLOW_CORE_EXPORT
SharedData {
SharedData
{
void *ptr;
int16_t refs;
int16_t wrefs;
};
//! @endcond

/*! @brief Shared Pointer Class */
/*!
* @brief Shared Pointer
*/
template <class T>
class Shared
{
@@ -45,7 +45,9 @@ MARSHMALLOW_NAMESPACE_BEGIN

namespace Core
{
/*! @brief Core StrHash Class */
/*!
* An extended Core:Hash that uses a string as the buffer to hash.
*/
class MARSHMALLOW_CORE_EXPORT
StrHash : public Hash
{
@@ -68,11 +70,15 @@ namespace Core
StrHash(const StrHash &copy);
virtual ~StrHash(void);

/*! @brief Unique ID */
/*!
* @brief Unique ID
*/
MMUID uid(void) const
{ return(result()); }

/*! @brief Hashed String */
/*!
* @brief Hashed String
*/
const std::string & str(void) const;

public: /* operator */
@@ -51,7 +51,9 @@ namespace Core

struct SharedData;

/*! @brief Weak Pointer Class */
/*!
* @brief Weak Pointer
*/
template <class T>
class Weak
{
@@ -44,7 +44,9 @@ MARSHMALLOW_NAMESPACE_BEGIN

namespace Core
{
/*! @brief Core Zlib Interface */
/*!
* @brief A collection of methods used to inflate and deflate data
*/
namespace Zlib
{
enum CompressionLevel
@@ -56,36 +58,34 @@ namespace Core

};

/*! @brief Zlib inflate
* @param in In buffer
* @param in_size In buffer size
* @param out_size Out buffer max size estimate
* @param out Out buffer pointer
/*!
* Inflate a zlib compressed buffer, out buffer allocation is
* handled by the function.
*
* Inflate a zlib compressed buffer, out buffer allocation is
* handled by the function.
* Deallocation will be automatic by the double buffered
* allocator. (not yet implemented)
*
* Deallocation will be automatic by the double buffered
* allocator. (not yet implemented)
*
* @return Actual out buffer size
* @param in In buffer
* @param in_size In buffer size
* @param out_size Out buffer max size estimate
* @param out Out buffer pointer
* @return Actual out buffer size
*/
MARSHMALLOW_CORE_EXPORT
size_t Inflate(const char *in, size_t in_size, size_t out_size, char **out);

/*! @brief Zlib deflate
* @param in In buffer
* @param in_size In buffer size
* @param out Out buffer pointer
* @param level Compression level
*
* Deflate a buffer using zlib compression, out buffer
* allocation is handled by the function.
/*!
* Deflate a buffer using zlib compression, out buffer
* allocation is handled by the function.
*
* Deallocation will be automatic by the double buffered
* allocator. (not yet implemented)
* Deallocation will be automatic by the double buffered
* allocator. (not yet implemented)
*
* @return Actual Out buffer size
* @param in In buffer
* @param in_size In buffer size
* @param out Out buffer pointer
* @param level Compression level
* @return Actual Out buffer size
*/
MARSHMALLOW_CORE_EXPORT
size_t Deflate(const char *in, size_t in_size, char **out, int level = DefaultCompression);