Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
T_Spatial_search_module< ModuleTraits, ApproximatedSpatialSearchEngine > Class Template Reference

Module building a data base for spatial-search from an input set of points. More...

#include "Spatial_search_module.hpp"

Static Public Member Functions

static boost::program_options::options_description *& get_options (void)
 Access to the options' description of the module. More...
 

Modules Management

void set_module_instance_name (const std::string &module_instance_name)
 Sets a name for this instance of this module. In particular, it will be used in the prefix of output files generated by a collection of modules. More...
 
const std::string & get_module_instance_name (void) const
 Get the name of this instance of this module. More...
 
void set_report_mode (std::ios_base::openmode report_mode)
 Set a report mode, that is open or append modes. More...
 
void set_report_mode (std::ios_base::openmode &report_mode)
 Set a report mode, that is open or append modes. More...
 
const std::ios_base::openmode get_report_mode (void) const
 Get the report mode to be used when reporting. More...
 

Others

template<class Self_ >
Self_ * clone (const Self_ *s) const
 Clones the object using the copy constructor. More...
 
virtual bool is_logical_module (void) const
 Checks that this module defines a logical operator. More...
 
virtual bool is_condition_module (void) const
 Checks that this module defines a condition operator. More...
 
virtual bool operator() (void)
 Only for condition modules, for returning the predicate value. More...
 
virtual bool is_modules_collection (void) const
 Checks that this module defines a collection of modules. More...
 

Traits Requirements

typedef ModuleTraits::Points_container Points_container
 Container of points to insert. More...
 
typedef Points_container::value_type Point
 Definition of a point. More...
 
typedef ModuleTraits::Distance Distance
 Distance between two input points. More...
 
typedef SBL::GT::T_NN_metric_tree< DistanceExact_spatial_search_engine
 Nearest neighbor engine designed for metric spaces. More...
 
typedef Distance::FT FT
 Distance number type that is returned. More...
 
typedef ApproximatedSpatialSearchEngine Approximated_spatial_search_engine
 Approximated spatial search engine (e.g SBL::GT::T_ANN_meta) More...
 

Input Accessors

Points_container *& get_points (void)
 Reference to the input pointa container. More...
 

Output Accessors

Spatial_search_engine & get_spatial_search_engine (void)
 Reference to the spatial search engine. More...
 

Mandatory Requirements

void run (unsigned verbose, std::ostream &out)
 Runs the module following the input options. More...
 
bool is_runnable (void) const
 Checks that all the input options were set. More...
 
void statistics (std::ostream &out)
 Reports high-level statistics on the module. More...
 
std::string get_name (void) const
 Returns the name of the package. More...
 

Optional Requirements

boost::program_options::options_description add_options (void) const
 Virtual method for adding options to the module. More...
 
bool check_options (std::string &message) const
 Checks that the input options' values are coherent. More...
 
std::string get_output_prefix (void) const
 Returns a prefix that concatains the input line options used when running the module. More...
 
void report (const std::string &prefix)
 Reports the output and statistics in output files. More...
 

Detailed Description

template<class ModuleTraits, class ApproximatedSpatialSearchEngine = SBL::GT::T_ANN_meta<SBL::GT::T_ANN_metric_space_proximity_tree<typename ModuleTraits::Distance> >>
class SBL::Modules::T_Spatial_search_module< ModuleTraits, ApproximatedSpatialSearchEngine >

Module building a data base for spatial-search from an input set of points.

It is designed such that a user has the choice between an exact and an approximated spatial search engine.

Template Parameters
ModuleTraitsTraits class defining the types T_Spatial_search_module::Points_Container, T_Spatial_search_module::Distance, T_Spatial_search_module::Approximated_spatial_search_engine.

Member Typedef Documentation

◆ Approximated_spatial_search_engine

typedef ApproximatedSpatialSearchEngine Approximated_spatial_search_engine

Approximated spatial search engine (e.g SBL::GT::T_ANN_meta)

◆ Distance

typedef ModuleTraits::Distance Distance

Distance between two input points.

◆ Exact_spatial_search_engine

Nearest neighbor engine designed for metric spaces.

...

◆ FT

typedef Distance::FT FT

Distance number type that is returned.

◆ Point

typedef Points_container::value_type Point

Definition of a point.

◆ Points_container

typedef ModuleTraits::Points_container Points_container

Container of points to insert.

Member Function Documentation

◆ add_options()

boost::program_options::options_description add_options ( void  ) const
inlinevirtual

Virtual method for adding options to the module.

Reimplemented from T_Module_option_description<>.

◆ check_options()

bool check_options ( std::string &  message) const
inlinevirtual

Checks that the input options' values are coherent.

Reimplemented from T_Module_option_description<>.

◆ clone()

Self_* clone ( const Self_ *  s) const
inlineinherited

Clones the object using the copy constructor.

◆ get_module_instance_name()

const std::string& get_module_instance_name ( void  ) const
inlineinherited

Get the name of this instance of this module.

◆ get_name()

std::string get_name ( void  ) const
inlinevirtual

Returns the name of the package.

Reimplemented from Module_base.

◆ get_options()

static boost::program_options::options_description*& get_options ( void  )
inlinestaticinherited

Access to the options' description of the module.

◆ get_output_prefix()

std::string get_output_prefix ( void  ) const
inlinevirtual

Returns a prefix that concatains the input line options used when running the module.

Reimplemented from T_Module_option_description<>.

◆ get_points()

T_Spatial_search_module< ModuleTraits, ApproximatedSpatialSearchEngine >::Points_container *& get_points ( void  )
inline

Reference to the input pointa container.

◆ get_report_mode()

const std::ios_base::openmode get_report_mode ( void  ) const
inlineinherited

Get the report mode to be used when reporting.

◆ get_spatial_search_engine()

T_Spatial_search_module< ModuleTraits, ApproximatedSpatialSearchEngine >::Spatial_search_engine & get_spatial_search_engine ( void  )
inline

Reference to the spatial search engine.

◆ is_condition_module()

virtual bool is_condition_module ( void  ) const
inlineprotectedvirtualinherited

Checks that this module defines a condition operator.

◆ is_logical_module()

virtual bool is_logical_module ( void  ) const
inlineprotectedvirtualinherited

Checks that this module defines a logical operator.

◆ is_modules_collection()

virtual bool is_modules_collection ( void  ) const
inlineprotectedvirtualinherited

Checks that this module defines a collection of modules.

◆ is_runnable()

bool is_runnable ( void  ) const
inlinevirtual

Checks that all the input options were set.

Reimplemented from Module_base.

◆ operator()()

virtual bool operator() ( void  )
inlineprotectedvirtualinherited

Only for condition modules, for returning the predicate value.

◆ report()

void report ( const std::string &  prefix)
inlinevirtual

Reports the output and statistics in output files.

Reimplemented from Module_base.

◆ run()

void run ( unsigned  verbose,
std::ostream &  out 
)
inlinevirtual

Runs the module following the input options.

Implements Module_base.

◆ set_module_instance_name()

void set_module_instance_name ( const std::string &  module_instance_name)
inlineinherited

Sets a name for this instance of this module. In particular, it will be used in the prefix of output files generated by a collection of modules.

◆ set_report_mode() [1/2]

void set_report_mode ( std::ios_base::openmode  report_mode)
inlineinherited

Set a report mode, that is open or append modes.

◆ set_report_mode() [2/2]

void set_report_mode ( std::ios_base::openmode &  report_mode)
inlineinherited

Set a report mode, that is open or append modes.

◆ statistics()

void statistics ( std::ostream &  out)
inlinevirtual

Reports high-level statistics on the module.

Reimplemented from Module_base.