<commit_before>// $Id: shiftModel.h,v 1.6 2001/05/16 09:57:45 amoll Exp $

#ifndef BALL_NMR_SHIFTMODEL_H
#define BALL_NMR_SHIFTMODEL_H

#ifndef BALL_NMR_SHIFTMODULE_H
#	include <BALL/NMR/shiftModule.h>
#endif

#ifndef BALL_DATATYPE_OPTIONS_H
#	include <BALL/DATATYPE/options.h>
#endif

#ifndef BALL_FORMAT_PARAMETERS_H
#	include <BALL/FORMAT/parameters.h>
#endif

namespace BALL 
{

	/**	A class representing a complete parameterized NMR shift model.
			The model consists of a set of single contributions (e.g. ring curent,
			magnetic anisotropy, etc.). Each of these contributions is calculated
			by a separate \Ref{ShiftModule} object. ShiftModel contains a list of 
			these processors and is also derived from ShiftModul. Hence, it can
			be applied to arbitrary kernel objects in the same fashion as \Ref{ShiftModule}s.	\\
			{\bf Definition:}\URL{BALL/NMR/shiftModel.h}
	*/
	class ShiftModel 
		: public ShiftModule		
	{
		public:	

		BALL_CREATE(ShiftModel)

		/**	@name	Type definitions
		*/
		//@{

		/**	The module list type
		*/
		typedef List<ShiftModule*> ModuleList;

		/**	The creation method type.
				This type describes a method that can construct an object
				of type ShiftModule.
		*/
		typedef void * (*CreateMethod) ();

		/**	The creation method hash map type.
				This type is used internally to store the creation
				method corresponding to a certain symbolic name (usually the class name).
		*/
		typedef StringHashMap<CreateMethod>	CreateMethodMap;

		//@}
		/**	@name Constants
		*/
		//@{

		/**	The name of the section containing the module types and names of the model
		*/
		static const char* MODULE_LIST_SECTION;

		//@}
		/**	@name	Constructors and Destructors
		*/
		//@{
		
		/** Default Constructor
		*/
		ShiftModel()
			throw();

		/** Detailed Constructor
		*/
		ShiftModel(const String& filename)
			throw();

		/**	Copy constructor
		*/
		ShiftModel(const ShiftModel& model)
			throw();

		/**	Destructor
		*/
		virtual ~ShiftModel()
			throw();

		/**	Clear method.
				This method destructs all shift modules in the module list.
				Then, it clears the module list, the parameters, and the options.		
		*/
		void clear()
			throw();

		//@}
		/**	@name Accessors
		*/	
		//@{

		/**
		*/
		Parameters& getParameters()
			throw();

		/**	Return the list of modules
		*/
		ModuleList& getModuleList()
			throw();

		/**	Set the parameter filename.
		*/
		void setFilename(const String& filename)
			throw(Exception::FileNotFound);

		/**	Return the parameter filename.
		*/
		const String& getFilename() const
			throw();
		
		/**	Register a new module type.
		*/
		void registerModule(const String& name, CreateMethod method) 
			throw(Exception::NullPointer);

		/**	Unregister a module type.
		*/
		void unregisterModule(const String& name) 
			throw();

		//@}
		/**	@name	Predicates
		*/
		//@{
			
		/**	Validity flag
		*/
		bool isValid() const
			throw();

		/**	Check whether a module of this name is registered
		*/
		bool isRegistered(const String& name) const
			throw();

		//@}
		/**	@name	Assignment
		*/
		//@{
			
		/**	Assignment operator
		*/
		const ShiftModel& operator = (const ShiftModel& model)
			throw();

		/**	Assignment operator (via filename).
		*/
		const ShiftModel& operator = (const String& filename)
			throw();

		//@}
		/**	@name Public Attributes
		*/
		//@{

		/**	Options
		*/
		Options options;

		//@}
		/**	@name	Processor related methods
		*/
		//@{

		/**	Start method
		*/
		bool start()
			throw();

		/**	Finish method
		*/
		bool finish()
			throw();

		/**	Application method
		*/
		Processor::Result operator () (Composite& composite)
			throw();
		//@}

		protected:

		/*_	Initialize the model from the parameter file.
				This method assumes that object has a valid	parameter file assigned.
				It sets {\tt valid_} to {\bf true} if it could create a shift model 
				from the contents of the parameter file.
		*/
		bool init_()
			throw(Exception::FileNotFound);

		/*_	Create a ShiftModule from a symbolic name.
				This method create a shift module from the symbolic
				name if this name is contained in the hash map \Ref{registered_modules_}.
		*/
		ShiftModule* createModule_(const String& type, const String& name) const
			throw();

		/*_	Register the standard modules.
		*/
		void registerStandardModules_()
			throw();
		
		/*_	The parameters object
		*/
		Parameters				parameters_;

		/*_	The list of shift modules of this model
		*/
		ModuleList				modules_;

		/*_	A hash map containing all registered module types and their creation methods.
		*/
		CreateMethodMap	registered_modules_;

		/*_	The validity flag.
				Set to {\bf true} if the object was initialized correctly.
		*/
		bool valid_;
	};

} // namespace BALL

#endif // BALL_NMR_SHIFTMODEL_H
<commit_msg>fixed: docu<commit_after>// $Id: shiftModel.h,v 1.7 2001/05/16 13:25:15 amoll Exp $

#ifndef BALL_NMR_SHIFTMODEL_H
#define BALL_NMR_SHIFTMODEL_H

#ifndef BALL_NMR_SHIFTMODULE_H
#	include <BALL/NMR/shiftModule.h>
#endif

#ifndef BALL_DATATYPE_OPTIONS_H
#	include <BALL/DATATYPE/options.h>
#endif

#ifndef BALL_FORMAT_PARAMETERS_H
#	include <BALL/FORMAT/parameters.h>
#endif

namespace BALL 
{

	/**	A class representing a complete parameterized NMR shift model.
			The model consists of a set of single contributions (e.g. ring curent,
			magnetic anisotropy, etc.). Each of these contributions is calculated
			by a separate \Ref{ShiftModule} object. ShiftModel contains a list of 
			these processors and is also derived from ShiftModul. Hence, it can
			be applied to arbitrary kernel objects in the same fashion as \Ref{ShiftModule}s.	\\
			{\bf Definition:} \URL{BALL/NMR/shiftModel.h}
	*/
	class ShiftModel 
		: public ShiftModule		
	{
		public:	

		BALL_CREATE(ShiftModel)

		/**	@name	Type definitions
		*/
		//@{

		/**	The module list type
		*/
		typedef List<ShiftModule*> ModuleList;

		/**	The creation method type.
				This type describes a method that can construct an object
				of type ShiftModule.
		*/
		typedef void * (*CreateMethod) ();

		/**	The creation method hash map type.
				This type is used internally to store the creation
				method corresponding to a certain symbolic name (usually the class name).
		*/
		typedef StringHashMap<CreateMethod>	CreateMethodMap;

		//@}
		/**	@name Constants
		*/
		//@{

		/**	The name of the section containing the module types and names of the model
		*/
		static const char* MODULE_LIST_SECTION;

		//@}
		/**	@name	Constructors and Destructors
		*/
		//@{
		
		/** Default Constructor
		*/
		ShiftModel()
			throw();

		/** Detailed Constructor
		*/
		ShiftModel(const String& filename)
			throw();

		/**	Copy constructor
		*/
		ShiftModel(const ShiftModel& model)
			throw();

		/**	Destructor
		*/
		virtual ~ShiftModel()
			throw();

		/**	Clear method.
				This method destructs all shift modules in the module list.
				Then, it clears the module list, the parameters, and the options.		
		*/
		void clear()
			throw();

		//@}
		/**	@name Accessors
		*/	
		//@{

		/**
		*/
		Parameters& getParameters()
			throw();

		/**	Return the list of modules
		*/
		ModuleList& getModuleList()
			throw();

		/**	Set the parameter filename.
		*/
		void setFilename(const String& filename)
			throw(Exception::FileNotFound);

		/**	Return the parameter filename.
		*/
		const String& getFilename() const
			throw();
		
		/**	Register a new module type.
		*/
		void registerModule(const String& name, CreateMethod method) 
			throw(Exception::NullPointer);

		/**	Unregister a module type.
		*/
		void unregisterModule(const String& name) 
			throw();

		//@}
		/**	@name	Predicates
		*/
		//@{
			
		/**	Validity flag
		*/
		bool isValid() const
			throw();

		/**	Check whether a module of this name is registered
		*/
		bool isRegistered(const String& name) const
			throw();

		//@}
		/**	@name	Assignment
		*/
		//@{
			
		/**	Assignment operator
		*/
		const ShiftModel& operator = (const ShiftModel& model)
			throw();

		/**	Assignment operator (via filename).
		*/
		const ShiftModel& operator = (const String& filename)
			throw();

		//@}
		/**	@name Public Attributes
		*/
		//@{

		/**	Options
		*/
		Options options;

		//@}
		/**	@name	Processor related methods
		*/
		//@{

		/**	Start method
		*/
		bool start()
			throw();

		/**	Finish method
		*/
		bool finish()
			throw();

		/**	Application method
		*/
		Processor::Result operator () (Composite& composite)
			throw();
		//@}

		protected:

		/*_	Initialize the model from the parameter file.
				This method assumes that object has a valid	parameter file assigned.
				It sets {\tt valid_} to {\bf true} if it could create a shift model 
				from the contents of the parameter file.
		*/
		bool init_()
			throw(Exception::FileNotFound);

		/*_	Create a ShiftModule from a symbolic name.
				This method create a shift module from the symbolic
				name if this name is contained in the hash map \Ref{registered_modules_}.
		*/
		ShiftModule* createModule_(const String& type, const String& name) const
			throw();

		/*_	Register the standard modules.
		*/
		void registerStandardModules_()
			throw();
		
		/*_	The parameters object
		*/
		Parameters				parameters_;

		/*_	The list of shift modules of this model
		*/
		ModuleList				modules_;

		/*_	A hash map containing all registered module types and their creation methods.
		*/
		CreateMethodMap	registered_modules_;

		/*_	The validity flag.
				Set to {\bf true} if the object was initialized correctly.
		*/
		bool valid_;
	};

} // namespace BALL

#endif // BALL_NMR_SHIFTMODEL_H

{'fraction_non_alphanumeric': 0.11408553801108438, 'fraction_numerical': 0.0033462302624699364, 'mean_word_length': 2.87363304981774, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '2463150', 'n_tokens_mistral': 3554, 'n_tokens_neox': 2926, 'n_words': 976}