#ifndef JOYCUB_OBJECT_H
#define JOYCUB_OBJECT_H
// joycub V2 - an interpeter for the programming language Joy
// (c) 2004-2006 Sergey Zubkov 

#include <string>
#include <sstream>
#include "globals.h"

// object.h
// static char RCSID[] ="$Id: object.h,v 1.7 2006/02/27 18:44:01 cubbi Exp $";

// The base class for all joycub V2's objects.
class JC_object {
protected:
	// reference counter. Non-zero for all in-scope objects
    unsigned int ref_count;
public:
	JC_object(void);
	virtual ~JC_object(void);

    virtual const obj_type get_type(void) const = 0; // will I even need this in new design?
	virtual std::string to_string(void) const = 0;    // output contents
	virtual std::string key(void) const = 0;              // hash key for the object pool
	virtual std::string to_output_string(void) const; 
	inline void inc_ref(void) { ref_count++; };
	inline void dec_ref(void) { ref_count--; };
	inline int get_ref(void) { return ref_count;};
};
#endif
