mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-04 09:05:34 -05:00
improved serializer documentation
This commit is contained in:
parent
cecd9a3368
commit
16b8947af1
@ -1,3 +1,28 @@
|
||||
/*
|
||||
* libretroshare/src/serialiser: rsserializer.cc
|
||||
*
|
||||
* RetroShare Serialiser.
|
||||
*
|
||||
* Copyright 2016 by Cyril Soler
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License Version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA.
|
||||
*
|
||||
* Please report all bugs and problems to "csoler@users.sourceforge.net".
|
||||
*
|
||||
*/
|
||||
|
||||
#include <typeinfo>
|
||||
|
||||
#include "rsitems/rsitem.h"
|
||||
|
@ -1,3 +1,27 @@
|
||||
/*
|
||||
* libretroshare/src/serialiser: rsserializer.h
|
||||
*
|
||||
* RetroShare Serialiser.
|
||||
*
|
||||
* Copyright 2016 by Cyril Soler
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License Version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA.
|
||||
*
|
||||
* Please report all bugs and problems to "csoler@users.sourceforge.net".
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -137,6 +161,8 @@ class RsItem ;
|
||||
|
||||
#define SERIALIZE_ERROR() std::cerr << __PRETTY_FUNCTION__ << " : "
|
||||
|
||||
// This is the base class for serializers.
|
||||
|
||||
class RsSerialType
|
||||
{
|
||||
public:
|
||||
@ -155,6 +181,7 @@ private:
|
||||
uint32_t type;
|
||||
};
|
||||
|
||||
// This class is only used internally to p3service. It should not be used explicitely otherwise.
|
||||
|
||||
class RsRawSerialiser: public RsSerialType
|
||||
{
|
||||
@ -167,6 +194,8 @@ class RsRawSerialiser: public RsSerialType
|
||||
virtual RsItem * deserialise(void *data, uint32_t *size);
|
||||
};
|
||||
|
||||
// Top class for all services and config serializers.
|
||||
|
||||
class RsGenericSerializer: public RsSerialType
|
||||
{
|
||||
public:
|
||||
@ -226,6 +255,8 @@ protected:
|
||||
|
||||
};
|
||||
|
||||
// Top class for service serializers. Derive your on service serializer from this class and overload creat_item().
|
||||
|
||||
class RsServiceSerializer: public RsGenericSerializer
|
||||
{
|
||||
public:
|
||||
@ -243,6 +274,8 @@ public:
|
||||
RsItem *deserialise(void *data,uint32_t *size) ;
|
||||
};
|
||||
|
||||
// Top class for config serializers. Config serializers are only used internally by RS core. The development of new services or plugins do not need this.
|
||||
|
||||
class RsConfigSerializer: public RsGenericSerializer
|
||||
{
|
||||
public:
|
||||
|
@ -1,3 +1,27 @@
|
||||
/*
|
||||
* libretroshare/src/serialiser: rstypeserializer.cc
|
||||
*
|
||||
* RetroShare Serialiser.
|
||||
*
|
||||
* Copyright 2017 by Cyril Soler
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License Version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA.
|
||||
*
|
||||
* Please report all bugs and problems to "csoler@users.sourceforge.net".
|
||||
*
|
||||
*/
|
||||
#include "serialiser/rsserializer.h"
|
||||
#include "serialiser/rstypeserializer.h"
|
||||
#include "serialiser/rsbaseserial.h"
|
||||
|
@ -1,3 +1,27 @@
|
||||
/*
|
||||
* libretroshare/src/serialiser: rstypeserializer.h
|
||||
*
|
||||
* RetroShare Serialiser.
|
||||
*
|
||||
* Copyright 2017 by Cyril Soler
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License Version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA.
|
||||
*
|
||||
* Please report all bugs and problems to "csoler@users.sourceforge.net".
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "serialiser/rsserial.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user