#include <object.h>
Inheritance diagram for Object:
Public Types | |
typedef std::string | id_t |
Public Member Functions | |
virtual | ~Object () |
virtual const id_t & | id () const =0 |
virtual Object * | create () const =0 |
Create a new object using the default constructor. | |
virtual Object * | clone () const =0 |
Create a new object by replicating itself. | |
Static Public Member Functions | |
static Object * | create (std::istream &) |
Create a new object from an input stream. | |
Protected Types | |
typedef UINT | ver_t |
typedef std::vector< ver_t > | ver_list |
Protected Member Functions | |
virtual bool | serialize (std::ostream &, ver_list &) const |
Serialize the object to an output stream. | |
virtual bool | unserialize (std::istream &, ver_list &, const id_t &=empty_id) |
Unserialize from an input stream. | |
Static Protected Attributes | |
static const id_t | empty_id |
Friends | |
std::istream & | operator>> (std::istream &, Object &) |
std::ostream & | operator<< (std::ostream &, const Object &) |
Object class collects some very common and useful features. It has a static string for identification and several funtional interfaces.
Definition at line 62 of file object.h.
|
|
|
|
|
|
|
|
|
Create a new object by replicating itself.
return new Derived(*this);
Implemented in AdaBoost, AdaBoost_ECOC, Aggregating, Bagging, Boosting, Cascade, CGBoost, FeedForwardNN, LearnModel, LPBoost, MgnBoost, MultiClass_ECOC, NNLayer, Perceptron, Pulse, Stump, and SVM. |
|
Create a new object from an input stream.
Definition at line 117 of file object.cpp. References unserialize(). |
|
Create a new object using the default constructor. The code for a derived class Derived is always return new Derived(); Implemented in AdaBoost, AdaBoost_ECOC, Aggregating, Bagging, Boosting, Cascade, CGBoost, FeedForwardNN, LearnModel, LPBoost, MgnBoost, MultiClass_ECOC, NNLayer, Perceptron, Pulse, Stump, and SVM. Referenced by FeedForwardNN::unserialize(), and Aggregating::unserialize(). |
|
Implemented in AdaBoost, AdaBoost_ECOC, Bagging, Boosting, CGBoost, FeedForwardNN, LPBoost, MgnBoost, MultiClass_ECOC, NNLayer, Perceptron, Pulse, Stump, and SVM. Referenced by serialize(). |
|
Serialize the object to an output stream. Serialization ``writes'' the object to an output stream, which helps to store, transport, and transform the object. See C++ FAQ Lite 35 for a technical overview.
A class that adds some data to its parent's serialization should call serialize() of its parent with its own version number appended to vl. Eventually Object::serialize() is called to output the class id and the list of versions.
Definition at line 61 of file object.cpp. References id(). Referenced by operator<<(). |
|
Unserialize from an input stream.
Definition at line 101 of file object.h. Referenced by create(), and operator>>(). |
|
|
|
Definition at line 132 of file object.cpp. |
|
Definition at line 95 of file object.h. Referenced by Stump::unserialize(), Pulse::unserialize(), Perceptron::unserialize(), NNLayer::unserialize(), MultiClass_ECOC::unserialize(), LearnModel::unserialize(), FeedForwardNN::unserialize(), CGBoost::unserialize(), Cascade::unserialize(), Boosting::unserialize(), and Aggregating::unserialize(). |