What is the C/C++ equivalence of java.io.Serializable?
There're references to serialization libraries on:
And there are:
- http://troydhanson.github.io/tpl/index.html
- http://www.boost.org/doc/libs/1_41_0/libs/serialization/doc/index.html
- https://developers.google.com/protocol-buffers/docs/cpptutorial#optimization-tips
But do such an equivalence even exists?
So if I have an abstract class as follows in Java, how would a serializable class in C/C++ look like?
import java.io.Serializable;
public interface SuperMan extends Serializable{
/**
* Count the number of abilities.
* @return
*/
public int countAbility();
/**
* Get the ability with index k.
* @param k
* @return
*/
public long getAbility(int k);
/**
* Get the array of ability from his hand.
* @param k
* @return
*/
public int[] getAbilityFromHand(int k);
/**
* Get the finger of the hand.
* @param k
* @return
*/
public int[][] getAbilityFromFinger(int k);
//check whether the finger with index k is removed.
public boolean hasFingerRemoved(int k);
/**
* Remove the finger with index k.
* @param k
*/
public void removeFinger(int k);
}
Could any serializable C/C++ object just be inherited like in Java?
Aucun commentaire:
Enregistrer un commentaire