<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://editthis.info/skins/common/feed.css?207"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://editthis.info/giona/?action=history&amp;feed=atom&amp;title=GenericObject.cpp</id>
		<title>GenericObject.cpp - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://editthis.info/giona/?action=history&amp;feed=atom&amp;title=GenericObject.cpp"/>
		<link rel="alternate" type="text/html" href="http://editthis.info/giona/?title=GenericObject.cpp&amp;action=history"/>
		<updated>2026-07-05T03:32:40Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.15.1</generator>

	<entry>
		<id>http://editthis.info/giona/?title=GenericObject.cpp&amp;diff=1669&amp;oldid=prev</id>
		<title>Rmarino at 16:28, 19 December 2007</title>
		<link rel="alternate" type="text/html" href="http://editthis.info/giona/?title=GenericObject.cpp&amp;diff=1669&amp;oldid=prev"/>
				<updated>2007-12-19T16:28:08Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;http://editthis.info/giona/?title=GenericObject.cpp&amp;amp;diff=1669&amp;amp;oldid=1610&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Rmarino</name></author>	</entry>

	<entry>
		<id>http://editthis.info/giona/?title=GenericObject.cpp&amp;diff=1610&amp;oldid=prev</id>
		<title>Rmarino at 16:58, 13 December 2007</title>
		<link rel="alternate" type="text/html" href="http://editthis.info/giona/?title=GenericObject.cpp&amp;diff=1610&amp;oldid=prev"/>
				<updated>2007-12-13T16:58:51Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;http://editthis.info/giona/?title=GenericObject.cpp&amp;amp;diff=1610&amp;amp;oldid=1593&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Rmarino</name></author>	</entry>

	<entry>
		<id>http://editthis.info/giona/?title=GenericObject.cpp&amp;diff=1593&amp;oldid=prev</id>
		<title>Rmarino at 12:18, 13 December 2007</title>
		<link rel="alternate" type="text/html" href="http://editthis.info/giona/?title=GenericObject.cpp&amp;diff=1593&amp;oldid=prev"/>
				<updated>2007-12-13T12:18:12Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

		&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 12:18, 13 December 2007&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 184:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 184:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Il database Object Oriented Generico|BACK]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:Codice Sorgente]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:Codice Sorgente]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff generator: internal 2026-07-05 03:32:40 --&gt;
&lt;/table&gt;</summary>
		<author><name>Rmarino</name></author>	</entry>

	<entry>
		<id>http://editthis.info/giona/?title=GenericObject.cpp&amp;diff=1574&amp;oldid=prev</id>
		<title>Rmarino at 09:26, 6 July 2007</title>
		<link rel="alternate" type="text/html" href="http://editthis.info/giona/?title=GenericObject.cpp&amp;diff=1574&amp;oldid=prev"/>
				<updated>2007-07-06T09:26:06Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * GenericObject.cpp&lt;br /&gt;
 * =================&lt;br /&gt;
 * &lt;br /&gt;
 * Implementation of a generic object&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;bool.h&amp;quot;&lt;br /&gt;
#include &amp;quot;mytypes.h&amp;quot;&lt;br /&gt;
#include &amp;quot;GenericListNode.h&amp;quot;&lt;br /&gt;
#include &amp;quot;GenericList.h&amp;quot;&lt;br /&gt;
#include &amp;quot;GenericAttribute.h&amp;quot;&lt;br /&gt;
#include &amp;quot;GenericObject.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Constructor&lt;br /&gt;
 */&lt;br /&gt;
GenericObject::GenericObject()&lt;br /&gt;
{&lt;br /&gt;
	this-&amp;gt;attributeList = new GenericList();&lt;br /&gt;
	this-&amp;gt;description = EMPTY_STRING;&lt;br /&gt;
	this-&amp;gt;name = EMPTY_STRING;&lt;br /&gt;
	this-&amp;gt;lastError = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Returns last error code&lt;br /&gt;
 */&lt;br /&gt;
int GenericObject::getLastError()&lt;br /&gt;
{&lt;br /&gt;
	return this-&amp;gt;lastError;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Sets the name of the object&lt;br /&gt;
 */&lt;br /&gt;
void GenericObject::setName(STRING name)&lt;br /&gt;
{&lt;br /&gt;
	this-&amp;gt;name = name;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Returns the name of the object&lt;br /&gt;
 */&lt;br /&gt;
 STRING GenericObject::getName()&lt;br /&gt;
 {&lt;br /&gt;
 	return this-&amp;gt;name;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Returns the number of attributes&lt;br /&gt;
 */&lt;br /&gt;
int GenericObject::getAttributeNumber()&lt;br /&gt;
{&lt;br /&gt;
	return this-&amp;gt;attributeList-&amp;gt;getLength();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Sets the description of the object&lt;br /&gt;
 */&lt;br /&gt;
void GenericObject::setDescription(STRING description)&lt;br /&gt;
{&lt;br /&gt;
	this-&amp;gt;description = description;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Returns the description of the object&lt;br /&gt;
 */&lt;br /&gt;
STRING GenericObject::getDescription()&lt;br /&gt;
{&lt;br /&gt;
	return this-&amp;gt;description; 	&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Returns the value of the attribute&lt;br /&gt;
 */ &lt;br /&gt;
STRING GenericObject::getAttributeValue(STRING name)&lt;br /&gt;
{&lt;br /&gt;
	STRING value = EMPTY_STRING;&lt;br /&gt;
	GenericAttribute* att = this-&amp;gt;getAttribute(name);&lt;br /&gt;
	if(att!= NULL)&lt;br /&gt;
		value = att-&amp;gt;getValue();&lt;br /&gt;
	return value;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Returns the description of the attribute&lt;br /&gt;
 */&lt;br /&gt;
STRING GenericObject::getAttributeDescription(STRING description)&lt;br /&gt;
{&lt;br /&gt;
	STRING value = EMPTY_STRING;&lt;br /&gt;
	GenericAttribute* att = this-&amp;gt;getAttribute(name);&lt;br /&gt;
	if(att!= NULL)&lt;br /&gt;
		value = att-&amp;gt;getDescription();&lt;br /&gt;
	return value;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Sets the value of the attribute&lt;br /&gt;
 * If the attribute with such name does not exists, a new one &lt;br /&gt;
 * is created&lt;br /&gt;
 */&lt;br /&gt;
void GenericObject::setAttributeValue(STRING name, STRING value)&lt;br /&gt;
{&lt;br /&gt;
	GenericAttribute* att = this-&amp;gt;getAttribute(name);&lt;br /&gt;
	if(att == NULL)&lt;br /&gt;
	{&lt;br /&gt;
		att = new GenericAttribute();&lt;br /&gt;
		att-&amp;gt;setName(name);&lt;br /&gt;
		GenericListNode * node = new GenericListNode();&lt;br /&gt;
		node-&amp;gt;setElem((genericListElemT)att);&lt;br /&gt;
		this-&amp;gt;attributeList-&amp;gt;addNode(node);&lt;br /&gt;
	}&lt;br /&gt;
	att-&amp;gt;setValue(value);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Sets the description of the attribute if it exists.&lt;br /&gt;
 * returns FALSE if the attribute does not exist&lt;br /&gt;
 */&lt;br /&gt;
 BOOL GenericObject::setAttributeDescription(STRING name, STRING description)&lt;br /&gt;
 {&lt;br /&gt;
 	GenericAttribute* att = this-&amp;gt;getAttribute(name);&lt;br /&gt;
	if(att == NULL)&lt;br /&gt;
		return FALSE;&lt;br /&gt;
	att-&amp;gt;setDescription(description);&lt;br /&gt;
	return TRUE;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Returns the array of all attribute names&lt;br /&gt;
 */&lt;br /&gt;
 STRING* GenericObject::getAttributeNameList()&lt;br /&gt;
 {&lt;br /&gt;
 	int i = 0;&lt;br /&gt;
 	int length = this-&amp;gt;attributeList-&amp;gt;getLength();&lt;br /&gt;
 	STRING* array= new STRING [length];&lt;br /&gt;
 	GenericListNode * node = this-&amp;gt;attributeList-&amp;gt;getHead();&lt;br /&gt;
 	while(node != NULL)&lt;br /&gt;
 	{&lt;br /&gt;
 		GenericAttribute * att = (GenericAttribute *) (node-&amp;gt;getElem());&lt;br /&gt;
 		STRING name = att-&amp;gt;getName();&lt;br /&gt;
 		array[i] = name;&lt;br /&gt;
 		i++;&lt;br /&gt;
 		node = node-&amp;gt;getNext();&lt;br /&gt;
 	}&lt;br /&gt;
 	return array;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Private function&lt;br /&gt;
 * ===================&lt;br /&gt;
 * Returns the pointer of the attribute whose name is the one passed&lt;br /&gt;
 */&lt;br /&gt;
GenericAttribute* GenericObject::getAttribute(STRING name)&lt;br /&gt;
{&lt;br /&gt;
	GenericAttribute * att = NULL;&lt;br /&gt;
	GenericListNode* node = this-&amp;gt;attributeList-&amp;gt;getHead();&lt;br /&gt;
	BOOL found = FALSE;&lt;br /&gt;
	while(node != NULL)&lt;br /&gt;
	{&lt;br /&gt;
		att = (GenericAttribute*) node-&amp;gt;getElem();&lt;br /&gt;
		STRING attName = att-&amp;gt;getName();&lt;br /&gt;
		if(EQUAL_STRING(name, attName))&lt;br /&gt;
			return att;&lt;br /&gt;
		node = node-&amp;gt;getNext();&lt;br /&gt;
	}&lt;br /&gt;
	return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Destructor&lt;br /&gt;
 */&lt;br /&gt;
GenericObject::~GenericObject()&lt;br /&gt;
{&lt;br /&gt;
	delete (attributeList);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:Codice Sorgente]]&lt;/div&gt;</summary>
		<author><name>Rmarino</name></author>	</entry>

	</feed>