Ignore:
Timestamp:
Feb 17, 2009, 12:07:04 PM (15 years ago)
Author:
Christoph Mayer
Message:

-memory leaks und corruption gefixt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/SpoVNetProperties.h

    r2409 r2440  
    7070                KADEMLIA_OVERLAY = 2,
    7171        };
    72 private:
    73         Name name;
    74         SpoVNetID id;
    75         uint8_t  type;
    76         uint16_t idLength;
    77         NodeID initiator;
    78         bool hidden;
    7972
    80 public:
     73
    8174        /**
    8275         * This object holds the default settings for a newly created spovnet
    8376         * instance.
    8477         */
    85         const static SpoVNetProperties DEFAULT;
     78        static const SpoVNetProperties DEFAULT;
    8679
    87 public:
    8880        /**
    8981         * Constructs a new default SpoVnet property object.
    9082         */
    91         SpoVNetProperties() {
    92                 name = Name::random();
    93                 id = name.toSpoVNetId();
    94                 type = ONE_HOP_OVERLAY;
    95                 idLength = 192;
    96                 initiator = NodeID::UNSPECIFIED;
    97                 hidden = false;
    98         }
     83        SpoVNetProperties();
    9984
    10085        /**
     
    11398         * Copy constructor.
    11499         */
    115         SpoVNetProperties(const SpoVNetProperties& copy) {
    116                 this->name = copy.name;
    117                 this->id = copy.id;
    118                 this->type = copy.type;
    119                 this->idLength = copy.idLength;
    120                 this->initiator = copy.initiator;
    121                 this->hidden = copy.hidden;
    122         }
     100        SpoVNetProperties(const SpoVNetProperties& copy);
    123101
    124102        /**
    125103         * Destructor.
    126104         */
    127         ~SpoVNetProperties() {
    128         }
     105        virtual ~SpoVNetProperties();
    129106
    130107        /**
    131108         * Returns the canonical SpoVNet name
    132109         */
    133         const Name& getName() const {
    134                 return name;
    135         }
     110        const Name& getName() const;
    136111
    137112        /**
    138113         * Returns the SpoVNet id
    139114         */
    140         const SpoVNetID& getId() const {
    141                 return id;
    142         }
     115        const SpoVNetID& getId() const;
    143116
    144117        /**
     
    146119         * If the node id is unspecified, the initiator wanted to be anonymous.
    147120         */
    148         const NodeID& getInitiator() const {
    149                 return initiator;
    150         }
     121        const NodeID& getInitiator() const;
    151122
    152123        /**
    153124         * Returns the node identifier length in bites
    154125         */
    155         uint16_t getIdentifierLength() const {
    156                 return idLength;
    157         }
     126        uint16_t getIdentifierLength() const;
    158127
    159128        /**
    160129         * Returns the overlay type.
    161130         */
    162         const OverlayType getBaseOverlayType() const {
    163                 return (OverlayType)type;
    164         }
     131        const OverlayType getBaseOverlayType() const;
    165132
    166133        /**
    167134         * Returns true, if the spovnet is hidden
    168135         */
    169         bool isHidden() const {
    170                 return hidden;
    171         }
     136        bool isHidden() const;
    172137
    173138        /**
     
    176141         * @return A human readable string representation of the SpoVNet properties
    177142         */
    178         std::string toString() const {
    179                 std::ostringstream buf;
    180                 buf << "spovnet"
    181                         << " name=" << name.toString()
    182                         << " id=" << id.toString()
    183                                 << " base_overlay_type=" << type << " id_length="
    184                                 << idLength << " initiator=" << initiator
    185                                 << " hidden=" << hidden;
    186                 return buf.str();
    187         }
     143        std::string toString() const;
     144
     145private:
     146        Name name;
     147        SpoVNetID id;
     148        uint8_t  type;
     149        uint16_t idLength;
     150        NodeID initiator;
     151        bool hidden;
    188152};
    189153
    190 }
     154} // namespace ariba
    191155
    192156#endif /* SPOVNETPROPERTIES_H_ */
Note: See TracChangeset for help on using the changeset viewer.