Object.h

musicmud-2.1.6/include/Object.h · 871 B

From the archive musicmud2.1.6.tar.gz

Download the archive   « Back to the archive contents

#ifndef OBJECT_H
#define OBJECT_H

#include <typeinfo>
#include <string>
#include <map>

#include "base.h"

//! a class to associate data with an ID
class Object : public base {
 private:
 public:

  //! reference count
    int refcount;

    //! whether this object has quitted
    int quit;

    //! whether this object has been deleted
    int nuke_me;
    
    //! construct the object with given id
    Object(const char *_id);
    virtual ~Object();

    //! the object id
  const char *id;

  //! set /key/ to /val/
  virtual void set(const char *key, const char *val);
  //! set /key/ to /val/
  virtual void set(const char *key, int val) {
    base::set(key, val);
  }
  //! set /key/ to /val/
  virtual void set(const char *key, string val) {
    set(key, val.c_str());
  }
  //! get string of /key/
  virtual const char *get(const char *key) const;
};

#endif

Site Stats

Snippets: 1791
Codebases: 571