Boost serialization supplementation This studies have studied the serialized application of Boost :: XML_Serialization yesterday, especially in the XML_Serialization partialized part of the sequence of objects, it is worth studying, I spent some time looking at this part How is the code is implemented, and you will be recorded, do a note and friends. (1) Review Yesterday research to do the object sequenced part of the object to do the sequence Test * a = NULL; OA >> Boost_Serialization_nvp ( nvalue); OA >> Boost_Serialization_nvp (INTS); OA >> Boost_Serialization_nvp (a); At this time, it will generate the implementation of this part of the TEST object is to track the code is this (2) object creation. Process a. First, start from Operator >> (Test * & A) This operator starts B. Then call Load_Override (Test * & A, BPPST_PFTO INT) => Basic_Xml_iarchive :: load_override (test * & a, 0) c.basic_xml_iarchive: : Load_override (Test * & a, 0) This function is a few things, the node starts load_start ("A" / * Name, the default is the name of the variable * /), the node ends load_end ("a") The other is the core LOAD function. D.archive :: load function Do the type matching invoke (xml_iarchive, a / * is referenced * /) E.INVOKE function Do two main things, Register_Type (XML_iarchive, Test * & a) and xml_iarchive.load_pointer
The register_type function implements a brief description of the code. This function does not have any special features. It is mainly to generate a cobject_id structure that adds it to an array. COBJECT_ID needs a Basic_ISerializer structure, this structure saves two static Type pointer XML_iarchive's pointer, one is a pointer of Test *. Consider the following code to clear template
A brief description of the ar.load_pointer function, this function is a functional function of dynamically generating class instance. There is no code to process the version object ID. It is worth recording bpis_ptr-> load_object_ptr (Ar, Object_ID_Vector [ui] .address, co.file_version) this function is the more critical function, to achieve the following specific code template