Complete GxsChannels JSON API with blocking methods

RsGxsIfaceHelper::requestStatus expose it to JSON API
Implemented RsGxsIfaceHelper::waitToken to wait for GXS operations
RsItem::serial_process fix doxygen warning as it's a comment not documentation
RsTypeSerializer add JSON conversion methods for double [de]serialization not
	implemented yet
RsTypeSerializer_PRIVATE_{FROM,TO}_JSON_ARRAY fix doxygen warning as it's a
	comment not documentation
make GxsChannels::ExtraFileHash a bit more reasonable
jsonapi-generator fix unused variable warning if there is no input or output
	paramethers
jsonapi-generator fix generation for inerithed jsonapi methods
Convert to RsSerializable some Gxs structs for the JSON API
This commit is contained in:
Gioacchino Mazzurco 2018-06-26 13:20:24 +02:00
parent d731b665db
commit 15f39129f1
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
13 changed files with 316 additions and 82 deletions

View file

@ -335,6 +335,49 @@ bool RsTypeSerializer::from_JSON( const std::string& memberName,
return ret;
}
template<> /*static*/
uint32_t RsTypeSerializer::serial_size(const double&)
{
std::cerr << "Binary [de]serialization not implemented yet for double"
<< std::endl;
print_stacktrace();
return 0;
}
template<> /*static*/
bool RsTypeSerializer::serialize(uint8_t[], uint32_t, uint32_t&, const double&)
{
std::cerr << "Binary [de]serialization not implemented yet for double"
<< std::endl;
print_stacktrace();
return false;
}
template<> /*static*/
bool RsTypeSerializer::deserialize(const uint8_t[], uint32_t, uint32_t&, double&)
{
std::cerr << "Binary [de]serialization not implemented yet for double"
<< std::endl;
print_stacktrace();
return false;
}
template<> /*static*/
void RsTypeSerializer::print_data(const std::string& n, const double& V)
{ std::cerr << " [double ] " << n << ": " << V << std::endl; }
SIMPLE_TO_JSON_DEF(double)
template<> /*static*/
bool RsTypeSerializer::from_JSON( const std::string& memberName,
double& member, RsJson& jDoc )
{
SAFE_GET_JSON_V();
ret = ret && v.IsDouble();
if(ret) member = v.GetDouble();
return ret;
}
//============================================================================//
// std::string //

View file

@ -41,7 +41,7 @@
#include <errno.h>
/** INTERNAL ONLY helper to avoid copy paste code for std::{vector,list,set}<T>
/* INTERNAL ONLY helper to avoid copy paste code for std::{vector,list,set}<T>
* Can't use a template function because T is needed for const_cast */
#define RsTypeSerializer_PRIVATE_TO_JSON_ARRAY() do \
{ \
@ -75,7 +75,7 @@
ctx.mJson.AddMember(arrKey, arr, allocator);\
} while (false)
/** INTERNAL ONLY helper to avoid copy paste code for std::{vector,list,set}<T>
/* INTERNAL ONLY helper to avoid copy paste code for std::{vector,list,set}<T>
* Can't use a template function because std::{vector,list,set}<T> has different
* name for insert/push_back function
*/