<commit_before>// $Id: property.h,v 1.19 2001/01/20 00:25:18 amoll Exp $

#ifndef BALL_CONCEPT_PROPERTY_H
#define BALL_CONCEPT_PROPERTY_H

#ifndef BALL_COMMON_H
#	include <BALL/common.h>
#endif

#ifndef BALL_DATATYPE_BITVECTOR_H
#	include <BALL/DATATYPE/bitVector.h>
#endif

#ifndef BALL_CONCEPT_PERSISTENTOBJECT_H
#	include <BALL/CONCEPT/persistentObject.h>
#endif

#include <iostream>

namespace BALL 
{

	/**	@name	Properties
	*/
	//@{
	
	/** Named Property Class
	*/
	class NamedProperty
		:	public PersistentObject
	{
		public:

		BALL_CREATE(NamedProperty)

		/**	@name Enums
		*/
		//@{
		/**	The different types of data a NamedProperty may contain.
				
		*/
		enum Type
		{
			/**	@doc Bool-type properties can have the value {\bf true} or {\bf false}.
			*/
			BOOL,

			/** @doc Int-type properties contain a variable of type {\bf int}
			*/
			INT,

			/** @doc Unsigned-int-type properties contain a variable of type {\bf unsigned int}
			*/
			UNSIGNED_INT,

			/**	@doc Float-type properties contain a variable of type {\bf double}
			*/
			FLOAT,

			/**	@doc Double-type properties contain a variable of type {\bf double}
			*/
			DOUBLE,

			/** @doc String-type properties contain a pointer to a string.
					When destructing the property, the string is destructed, too. ???
			*/
			STRING,

			/**	Object-type properties contain a pointer to a PersistentObject.
					Remember to destruct the objects if they are not needed any more!
					the Destructor of NamedProperty will not delete this object!
			*/
			OBJECT,

			/** Properties of this type do not contain any data.
					Use this type to indicate that an object has a certain property.
					The type can be seen as an extension of the bit properties 
					used in PropertyManager except for the user-defined name.
			*/
			NONE
		};
		//@}

		/**	@name	Constructors and Destructors 
		*/
		//@{

		/*	The default constructor
		*/
		NamedProperty()
			throw();

		/**	Standard constructor.
				Creates an object of type NONE. Use this constructor to create
				it properties with user defined names.
				The {\tt Type} is set to \Ref{OBJECT}.
				@param	name the propertie's name
		*/
		NamedProperty(const string& name)
			throw();

		/**	Constructor for bool-type properties.
				Creates a NamedProperty object containing a boolean value.
				The {\tt Type} is set to \Ref{BOOL}.
				@param	name the property's name
				@param	value the boolean value stored in the property
		*/	
		NamedProperty(const string& name, bool value)
			throw();

		/**	Constructor for int-type properties.
				Creates a NamedProperty object containing a signed int value.
				The {\tt Type} is set to \Ref{INT}.
				@param	name the property's name
				@param	value the int value stored in the property
		*/
		NamedProperty(const string& name, int value)
			throw();

		/** Constructor for unsigned int-type properties.
				Creates a NamedProperty object containing an unsigned int value.
				The {\tt Type} is set to \Ref{UNSIGNED_INT}.
				@param	name the property's name
				@param	value the int value stored in the property
		*/
		NamedProperty(const string& name, unsigned int value)
			throw();

		/** Constructor for float-type properties.
				Creates a NamedProperty object containing a float value.
				The {\tt Type} is set to \Ref{FLOAT}.
				@param	name the property's name
				@param	value the float value stored in the property
		*/
		NamedProperty(const string& name, float value)
			throw();

		/** Constructor for double-type properties.
				Creates a NamedProperty object containing a double value.
				The {\tt Type} is set to \Ref{DOUBLE}.
				@param	name the property's name
				@param	value the double value stored in the property
		*/
		NamedProperty(const string& name, double value)
			throw();

		/** Constructor for string-type properties.
				Objects of type STRING contain a pointer to a string
				object. This object is constructed as a copy of {\tt str}
				The {\tt Type} is set to \Ref{STRING}.
				@param	name the property's name
				@param	str the string stored in the property
		*/
		NamedProperty(const string& name, string& str)
			throw();

		/**	Constructor for object-type properties.
				Creates a NamedProperty object containing a 
				pointer to a persistent object.
				The {\tt Type} is set to \Ref{OBJECT}.
				@param	name the property's name
				@param	po a reference to the persistent object stored in the property
		*/
		NamedProperty(const string& name, PersistentObject& po)
			throw();

		/**	Copy constructor
		*/
		NamedProperty(const NamedProperty&)
			throw();

		/**	Destructor .
				The destructor destructs the contained data in the case of STRING-type 
				properties only.
		*/
		~NamedProperty()
			throw();

		/** Clear method
		*/
		void clear()
			throw();
		//@}	

		/**	@name Persistence
		*/
		//@{
			
		/**	Write a persistent copy of the object.
		*/
    virtual void persistentWrite(PersistenceManager& pm, const char* name = "") const
			throw();

		/**	Retrieve a persistent copy of the object
		*/
    virtual void persistentRead(PersistenceManager& pm)
			throw();
		//@}
 
		
		/**	@name	 Accessors 
		*/<commit_msg>fixed: NamedProperty::clear is now virtual<commit_after>// $Id: property.h,v 1.20 2001/01/21 23:00:19 amoll Exp $

#ifndef BALL_CONCEPT_PROPERTY_H
#define BALL_CONCEPT_PROPERTY_H

#ifndef BALL_COMMON_H
#	include <BALL/common.h>
#endif

#ifndef BALL_DATATYPE_BITVECTOR_H
#	include <BALL/DATATYPE/bitVector.h>
#endif

#ifndef BALL_CONCEPT_PERSISTENTOBJECT_H
#	include <BALL/CONCEPT/persistentObject.h>
#endif

#include <iostream>

namespace BALL 
{

	/**	@name	Properties
	*/
	//@{
	
	/** Named Property Class
	*/
	class NamedProperty
		:	public PersistentObject
	{
		public:

		BALL_CREATE(NamedProperty)

		/**	@name Enums
		*/
		//@{
		/**	The different types of data a NamedProperty may contain.
				
		*/
		enum Type
		{
			/**	@doc Bool-type properties can have the value {\bf true} or {\bf false}.
			*/
			BOOL,

			/** @doc Int-type properties contain a variable of type {\bf int}
			*/
			INT,

			/** @doc Unsigned-int-type properties contain a variable of type {\bf unsigned int}
			*/
			UNSIGNED_INT,

			/**	@doc Float-type properties contain a variable of type {\bf double}
			*/
			FLOAT,

			/**	@doc Double-type properties contain a variable of type {\bf double}
			*/
			DOUBLE,

			/** @doc String-type properties contain a pointer to a string.
					When destructing the property, the string is destructed, too. ???
			*/
			STRING,

			/**	Object-type properties contain a pointer to a PersistentObject.
					Remember to destruct the objects if they are not needed any more!
					the Destructor of NamedProperty will not delete this object!
			*/
			OBJECT,

			/** Properties of this type do not contain any data.
					Use this type to indicate that an object has a certain property.
					The type can be seen as an extension of the bit properties 
					used in PropertyManager except for the user-defined name.
			*/
			NONE
		};
		//@}

		/**	@name	Constructors and Destructors 
		*/
		//@{

		/*	The default constructor
		*/
		NamedProperty()
			throw();

		/**	Standard constructor.
				Creates an object of type NONE. Use this constructor to create
				it properties with user defined names.
				The {\tt Type} is set to \Ref{OBJECT}.
				@param	name the propertie's name
		*/
		NamedProperty(const string& name)
			throw();

		/**	Constructor for bool-type properties.
				Creates a NamedProperty object containing a boolean value.
				The {\tt Type} is set to \Ref{BOOL}.
				@param	name the property's name
				@param	value the boolean value stored in the property
		*/	
		NamedProperty(const string& name, bool value)
			throw();

		/**	Constructor for int-type properties.
				Creates a NamedProperty object containing a signed int value.
				The {\tt Type} is set to \Ref{INT}.
				@param	name the property's name
				@param	value the int value stored in the property
		*/
		NamedProperty(const string& name, int value)
			throw();

		/** Constructor for unsigned int-type properties.
				Creates a NamedProperty object containing an unsigned int value.
				The {\tt Type} is set to \Ref{UNSIGNED_INT}.
				@param	name the property's name
				@param	value the int value stored in the property
		*/
		NamedProperty(const string& name, unsigned int value)
			throw();

		/** Constructor for float-type properties.
				Creates a NamedProperty object containing a float value.
				The {\tt Type} is set to \Ref{FLOAT}.
				@param	name the property's name
				@param	value the float value stored in the property
		*/
		NamedProperty(const string& name, float value)
			throw();

		/** Constructor for double-type properties.
				Creates a NamedProperty object containing a double value.
				The {\tt Type} is set to \Ref{DOUBLE}.
				@param	name the property's name
				@param	value the double value stored in the property
		*/
		NamedProperty(const string& name, double value)
			throw();

		/** Constructor for string-type properties.
				Objects of type STRING contain a pointer to a string
				object. This object is constructed as a copy of {\tt str}
				The {\tt Type} is set to \Ref{STRING}.
				@param	name the property's name
				@param	str the string stored in the property
		*/
		NamedProperty(const string& name, string& str)
			throw();

		/**	Constructor for object-type properties.
				Creates a NamedProperty object containing a 
				pointer to a persistent object.
				The {\tt Type} is set to \Ref{OBJECT}.
				@param	name the property's name
				@param	po a reference to the persistent object stored in the property
		*/
		NamedProperty(const string& name, PersistentObject& po)
			throw();

		/**	Copy constructor
		*/
		NamedProperty(const NamedProperty&)
			throw();

		/**	Destructor .
				The destructor destructs the contained data in the case of STRING-type 
				properties only.
		*/
		~NamedProperty()
			throw();

		/** Clear method
		*/
		virtual void clear()
			throw();
		//@}	

		/**	@name Persistence
		*/
		//@{
			
		/**	Write a persistent copy of the object.
		*/
    virtual void persistentWrite(PersistenceManager& pm, const char* name = "") const
			throw();

		/**	Retrieve a persistent copy of the object
		*/
    virtual void persistentRead(PersistenceManager& pm)
			throw();
		//@}
 
		
		/**	@name	 Accessors 
		*/
{'fraction_non_alphanumeric': 0.0950952887685015, 'fraction_numerical': 0.003289155460965464, 'mean_word_length': 2.8981900452488687, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '102053', 'n_tokens_mistral': 3691, 'n_tokens_neox': 3034, 'n_words': 1207}