Leosac  0.8.0
Open Source Access Control
Leosac::PolymorphicCredentialJSONSerializer Struct Reference

A serializer that handle any subclass of ICredential. More...

#include <PolymorphicCredentialSerializer.hpp>

Classes

struct  HelperSerialize
 Non static helper that can visit credential object. More...
 
struct  HelperUnserialize
 

Static Public Member Functions

static json serialize (const Cred::ICredential &in, const SecurityContext &sc)
 
static void unserialize (Cred::ICredential &out, const json &in, const SecurityContext &sc)
 
static std::string type_name (const Cred::ICredential &in)
 Returns the "type-name" of the credential. More...
 

Detailed Description

A serializer that handle any subclass of ICredential.

This credential, as opposed to CredentialJSONSerializer will fully serialize the object. This means that it will (try-to) find the correct serializer for the real type of the object.

Definition at line 40 of file PolymorphicCredentialSerializer.hpp.

Member Function Documentation

◆ serialize()

json PolymorphicCredentialJSONSerializer::serialize ( const Cred::ICredential in,
const SecurityContext sc 
)
static

Definition at line 33 of file PolymorphicCredentialSerializer.cpp.

◆ type_name()

std::string PolymorphicCredentialJSONSerializer::type_name ( const Cred::ICredential in)
static

Returns the "type-name" of the credential.

This is something that maps to EmberJS models.

For example, for an Cred::RFIDCard it would return "rfid-card".

Definition at line 50 of file PolymorphicCredentialSerializer.cpp.

◆ unserialize()

void PolymorphicCredentialJSONSerializer::unserialize ( Cred::ICredential out,
const json in,
const SecurityContext sc 
)
static

Definition at line 41 of file PolymorphicCredentialSerializer.cpp.


The documentation for this struct was generated from the following files: