Public Types | Public Member Functions
ESBTL::Generic_classifier< Properties_ > Struct Template Reference

#include <atom_classifier.h>

List of all members.

Public Types

typedef Properties_ Properties
typedef Properties_::Key_type Key_type
typedef Properties_::Query_type Query_type
typedef std::vector
< Properties_ >::iterator 
Properties_iterator
typedef std::vector
< Properties_ >
::const_iterator 
Properties_const_iterator

Public Member Functions

 Generic_classifier ()
 Generic_classifier (std::string filename, int)
 Generic_classifier (const std::string &filename)
const Propertiesget_properties (unsigned i) const
const Propertiesget_properties (const Query_type &query) const
unsigned number_of_properties () const
Properties_iterator properties_begin ()
Properties_const_iterator properties_begin () const
Properties_iterator properties_end ()
Properties_const_iterator properties_end () const

Detailed Description

template<class Properties_>
struct ESBTL::Generic_classifier< Properties_ >

An object that help to associate properties to objects. This can be used for example to to associate a radius or a color to an (pseudo-)atom type.

Template Parameters:
Properties_must follow the concept of Property class.

Member Typedef Documentation

template<class Properties_ >
typedef Properties_::Key_type ESBTL::Generic_classifier< Properties_ >::Key_type
template<class Properties_ >
typedef Properties_ ESBTL::Generic_classifier< Properties_ >::Properties
template<class Properties_ >
typedef std::vector<Properties_>::const_iterator ESBTL::Generic_classifier< Properties_ >::Properties_const_iterator
template<class Properties_ >
typedef std::vector<Properties_>::iterator ESBTL::Generic_classifier< Properties_ >::Properties_iterator
template<class Properties_ >
typedef Properties_::Query_type ESBTL::Generic_classifier< Properties_ >::Query_type

Constructor & Destructor Documentation

template<class Properties_ >
ESBTL::Generic_classifier< Properties_ >::Generic_classifier ( ) [inline]

Default constructor. The method Properties_::default_loader is called to fill in the dictionary and the property vector.

template<class Properties_ >
ESBTL::Generic_classifier< Properties_ >::Generic_classifier ( std::string  filename,
int   
) [inline]

Constructor that uses a file to complete the default properties. Not yet implemented

template<class Properties_ >
ESBTL::Generic_classifier< Properties_ >::Generic_classifier ( const std::string &  filename) [inline]

Constructor using a file, default is not loaded. The file must follow the following format:

 EXTRA
 ...
 END
 CLASSIFICATION
 ... i
 END
 PROPERTIES
  0  ...
 ... ...
  n  ...
 END
 DEFAULT
 i
 END

There are four different sections providing different kind of information:

  • EXTRA: For each line of the file, the function Properties_::handle_extra is called.
  • CLASSIFICATION: This section contains information to associate an object to an index. For each line of the file, the function Properties_::add_classification is called.
  • PROPERTIES: This section contains the properties. It must start by the index of the property followed by the information required to define the property. For each line of the file, a property is constructed using the constructor with a string stream and an unsigned integer. The property index is first extracted and the rest of the line is put into a string stream.
  • DEFAULT: This section defines the index of the default property (if needed).

Note that none of these sections are mandatory.


Member Function Documentation

template<class Properties_ >
const Properties& ESBTL::Generic_classifier< Properties_ >::get_properties ( unsigned  i) const [inline]

Returns a property given its index

Parameters:
iis the index of the desired property (starting from 0).
template<class Properties_ >
const Properties& ESBTL::Generic_classifier< Properties_ >::get_properties ( const Query_type query) const [inline]

Returns a property associated to a Query_type object.

Parameters:
queryis the object a property is looking for in the dictionary.
template<class Properties_ >
unsigned ESBTL::Generic_classifier< Properties_ >::number_of_properties ( ) const [inline]

returns the number of properties.

template<class Properties_ >
Properties_const_iterator ESBTL::Generic_classifier< Properties_ >::properties_begin ( ) const [inline]

Returns the first iterator on properties, const version.

template<class Properties_ >
Properties_iterator ESBTL::Generic_classifier< Properties_ >::properties_begin ( ) [inline]

Returns the first iterator on properties.

template<class Properties_ >
Properties_iterator ESBTL::Generic_classifier< Properties_ >::properties_end ( ) [inline]

Returns the past-end iterator on properties.

template<class Properties_ >
Properties_const_iterator ESBTL::Generic_classifier< Properties_ >::properties_end ( ) const [inline]

Returns the past-end iterator on properties, const version.


The documentation for this struct was generated from the following file: