[go: up one dir, main page]

Menu

[r1122]: / trunk / src / Distribution.h  Maximize  Restore  History

Download this file

51 lines (42 with data), 1.6 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//-------------------------------------------------------------------------------------------
//
// DistributionCalculator.h
//
// Author: Chi-Hsiu Liang
// Date: _2008_05_15_
//
// This file contains the definition of the distribution calculator plug-in class.
//
//-------------------------------------------------------------------------------------------
#ifndef GUARD_Distribution_h
#define GUARD_Distribution_h
#include <map>
#include "plugin.h"
namespace mesmer
{
class Molecule;
/** Abstract base class for distribution calculators
The derived concrete classes are plugin classes:
-- New classes can be added without changing any of the existing code.
They have a global instance, the constructor of which registers
the class with the base class. Subsequently, a pointer to the class is
obtained by supplying the id (a string) to the Find function.
**/
class DistributionCalculator : public TopPlugin
{
public:
static const char* typeID(){ return "Distribution Calculators"; }
virtual const char* getTypeID(){return typeID();}
//Get a pointer to a derived class by providing its id.
static DistributionCalculator* Find(const std::string& id)
{
return dynamic_cast<DistributionCalculator*>(TopFind(id, typeID()));
}
virtual bool calculateDistribution(Molecule* m_host, std::vector<double>& dist) = 0 ;
Molecule* getParent() {return m_parent;} ;
void setParent(Molecule* parent) { m_parent = parent;} ;
private:
Molecule* m_parent;
};
}//namespace
#endif