Skip to content
Commits on May 15, 2012
  1. @martin-seomoz
Commits on May 12, 2012
  1. @martin-seomoz

    Change in how it works.

    martin-seomoz committed
             All the macros now assume that the type they are working with is called `LocalType`
             This design changes is to minimise repetitive code.
             As this is a breaking change I am rolling the major version number.
             The previos version will be in a branch
    
             This means that code that looked like this:
    
                class MyClass
                {
                    int          member1;
                    double       member2;
                    std::string  member3;
    
                    friend class JsonSerializeTraits<MyClass>;
                };
    
                namespace ThorsAnvil { namespace Serialize { namespace Json {
    
                template<>
                class JsonSerializeTraits<MyClass>
                {
                    static ThorsAnvil::Serialize::Json::JsonSerializeType const  type    = Map;
    
                    THORSANVIL_SERIALIZE_JsonAttribute(MyClass, member1);
                    THORSANVIL_SERIALIZE_JsonAttribute(MyClass, member2);
                    THORSANVIL_SERIALIZE_JsonAttribute(MyClass, member3);
                    typedef boost::mps::vector<member1, member2, member3>   SerializeInfo;
                };
    
                }}}
             Now needs to look like this:
    
                class MyClass
                {
                    int          member1;
                    double       member2;
                    std::string  member3;
    
                    friend class JsonSerializeTraits<MyClass>;
                };
    
                namespace ThorsAnvil { namespace Serialize { namespace Json {
    
                template<>
                class JsonSerializeTraits<MyClass>
                {
                    // IMPORTANT:
                    // Added a typedef here
                    //
                    typedef MyClass LocalType;
                    static ThorsAnvil::Serialize::Json::JsonSerializeType const  type    = Map;
    
                    // Now each of these items just needs to mention the members.
                    // Thus making the macros easier to use.
                    THORSANVIL_SERIALIZE_JsonAttribute(member1);
                    THORSANVIL_SERIALIZE_JsonAttribute(member2);
                    THORSANVIL_SERIALIZE_JsonAttribute(member3);
                    typedef boost::mps::vector<member1, member2, member3>   SerializeInfo;
                };
    
                }}}
Commits on Apr 23, 2012
  1. @martin-seomoz

    Moved std::pair<> serialiation out of SerializerMap.h into Serializer…

    martin-seomoz committed
    …Memory.h to match std headers
Something went wrong with that request. Please try again.