GenericObject.h

From Giona

(Difference between revisions)
Line 3: Line 3:
#define GENERICOBJECT_H_
#define GENERICOBJECT_H_
-
#define GENERIC_OBJECT_ERROR_NO 0
+
#include <cstdlib>
 +
#include <cstring>
 +
 
 +
#include "gionaTypes.h"
 +
#include "Debug.h"
 +
#include "GenericListNode.h"
 +
#include "GenericList.h"
 +
#include "GenericAttribute.h"
class GenericObject
class GenericObject
{
{
public:
public:
 +
static const int ERROR_NO = 0;
 +
static const int ERROR_NULL_PARAMETER = 1;
 +
static const int ERROR_EMPTY_STRING = 2;
 +
static const int ERROR_ATTRIBUTE_NOT_FOUND = 3;
 +
GenericObject();
GenericObject();
virtual ~GenericObject();
virtual ~GenericObject();
int getLastError();
int getLastError();
int getAttributeNumber();
int getAttributeNumber();
-
void setName(STRING name);
+
bool setName(STRING name);
STRING getName();
STRING getName();
-
void setDescription(STRING description);
+
bool setDescription(STRING description);
STRING getDescription();
STRING getDescription();
STRING getAttributeValue(STRING name);
STRING getAttributeValue(STRING name);
-
STRING getAttributeDescription(STRING description);
+
STRING getAttributeDescription(STRING name);
-
void setAttributeValue(STRING name, STRING value);
+
bool setAttributeValue(STRING name, STRING value);
-
BOOL setAttributeDescription(STRING name, STRING description);
+
bool setAttributeDescription(STRING name, STRING description);
STRING* getAttributeNameList();
STRING* getAttributeNameList();
Line 27: Line 39:
GenericList * attributeList;
GenericList * attributeList;
int lastError;
int lastError;
-
 
GenericAttribute* getAttribute(STRING name);
GenericAttribute* getAttribute(STRING name);
};
};

Revision as of 16:58, 13 December 2007

#ifndef GENERICOBJECT_H_
#define GENERICOBJECT_H_

#include <cstdlib>
#include <cstring>

#include "gionaTypes.h"
#include "Debug.h"
#include "GenericListNode.h"
#include "GenericList.h"
#include "GenericAttribute.h"

class GenericObject
{
	public:
		static const int ERROR_NO 					= 0;
		static const int ERROR_NULL_PARAMETER 		= 1;
		static const int ERROR_EMPTY_STRING 		= 2;
		static const int ERROR_ATTRIBUTE_NOT_FOUND 	= 3;
		
		GenericObject();
		virtual ~GenericObject();
		int getLastError();
		int getAttributeNumber();
		bool setName(STRING name);
		STRING getName();
		bool setDescription(STRING description);
		STRING getDescription();
		STRING getAttributeValue(STRING name);
		STRING getAttributeDescription(STRING name);
		bool setAttributeValue(STRING name, STRING value);
		bool setAttributeDescription(STRING name, STRING description);
		STRING* getAttributeNameList();
		
	private:
		STRING name;
		STRING description;
		GenericList * attributeList;
		int lastError;
		GenericAttribute* getAttribute(STRING name);
};

#endif /*GENERICOBJECT_H_*/

BACK

Personal tools