Skip to content

Commit

Permalink
Add deserialization function and add documentation strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentzell committed Aug 13, 2024
1 parent b0ea7c5 commit c7659e0
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
20 changes: 17 additions & 3 deletions c++/cppdlr/dlr_imfreq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,23 @@ namespace cppdlr {
// -------------------- serialization -------------------

public:
template <class Archive> void serialize(Archive &ar) { //
ar & lambda_ & statistic & r & niom & dlr_rf & dlr_if & cf2if & if2cf.lu & if2cf.piv;
}

/**
* Serialize the object into an archive by serializing all its members.
* The archive parameter must support the operator& to serialize each member.
*
* @param[in] ar Archive to serialize into
*/
void serialize(auto &ar) const { ar & lambda_ & statistic & r & niom & dlr_rf & dlr_if & cf2if & if2cf.lu & if2cf.piv; }

/**
* Deserialize an object from the archive. This will initialize all members.
* The archive parameter must support the operator& to deserialize the members
* in the order they were serialized.
*
* @param[in] ar Archive to deserialize from
*/
void deserialize(auto &ar) { ar & lambda_ & statistic & r & niom & dlr_rf & dlr_if & cf2if & if2cf.lu & if2cf.piv; }

// -------------------- hdf5 -------------------

Expand Down
20 changes: 19 additions & 1 deletion c++/cppdlr/dlr_imtime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,25 @@ namespace cppdlr {
// -------------------- serialization -------------------

public:
template <class Archive> void serialize(Archive &ar) { //

/**
* Serialize the object into an archive by serializing all its members.
* The archive parameter must support the operator& to serialize each member.
*
* @param[in] ar Archive to serialize into
*/
void serialize(auto &ar) const {
ar & lambda_ & r & dlr_rf & dlr_it & cf2it & it2cf.lu & it2cf.zlu & it2cf.piv & hilb & tcf2it & thilb & ttcf2it & ipmat & refl;
}

/**
* Deserialize an object from the archive. This will initialize all members.
* The archive parameter must support the operator& to deserialize the members
* in the order they were serialized.
*
* @param[in] ar Archive to deserialize from
*/
void deserialize(auto &ar) {
ar & lambda_ & r & dlr_rf & dlr_it & cf2it & it2cf.lu & it2cf.zlu & it2cf.piv & hilb & tcf2it & thilb & ttcf2it & ipmat & refl;
}

Expand Down

0 comments on commit c7659e0

Please sign in to comment.