OBStereoBase Class Reference
[Stereochemistry]

Base class for all stereochemistry classes. More...

#include <openbabel/stereo/stereo.h>

Inheritance diagram for OBStereoBase:
OBGenericData OBTetraNonPlanarStereo OBTetraPlanarStereo OBTetrahedralStereo OBCisTransStereo OBSquarePlanarStereo

List of all members.

Public Member Functions

 OBStereoBase (OBMol *mol)
virtual ~OBStereoBase ()
virtual OBGenericDataClone (OBBase *) const
void SetAttribute (const std::string &v)
void SetOrigin (const DataOrigin s)
virtual const std::string & GetAttribute () const
unsigned int GetDataType () const
virtual const std::string & GetValue () const
virtual DataOrigin GetOrigin () const
Geniric (for all OBStereo::Type) stereochemistry
OBMolGetMolecule () const
virtual OBStereo::Type GetType () const =0
void SetSpecified (bool specified)
bool IsSpecified () const

Protected Attributes

std::string _attr
unsigned int _type
DataOrigin _source

Detailed Description

Base class for all stereochemistry classes.

All stereochemistry classes are derived from OBStereoBase. This class inherits from OBGenericData which allows the objects to be stored in the molecule. The attribute (OBGenericData::GetAttribute) is set to "StereoData" and the data type is OBGenericDataType::StereoData. The pure virtual OBStereoBase::GetType function must be implemented by derived classes to return a type defined in OBStereo::Type.

Use the OBStereoFacade for easy access to the derived classes.

OBStereoBase keeps track of the OBMol object. This must always be a valid (not 0 or deleted) pointer and can only be set using the constructor. Subclasses can use this to get more information on bonding for example. Finally, OBStereoBase also keeps track of the specified flag. By default, this is always set to true.

See also:
OBStereo OBStereoFacade
Since:
version 2.3

Constructor & Destructor Documentation

OBStereoBase ( OBMol mol ) [inline]

Constructor. By default, the stereochemistry is specified. Use SetSpecified(false) for unspecified/unknown stereochemistry.

Parameters:
molThe molecule.
virtual ~OBStereoBase (  ) [inline, virtual]

Destructor.


Member Function Documentation

OBMol* GetMolecule (  ) const [inline]

Get the molecule. This can be used by subclasses when more information is needed (e.g. OBCisTransStereo::GetCisRef, ...).

virtual OBStereo::Type GetType (  ) const [pure virtual]

Reimplemented by subclasses to return the type defined in OBStereo::Type.

Implemented in OBCisTransStereo, OBSquarePlanarStereo, and OBTetrahedralStereo.

void SetSpecified ( bool  specified ) [inline]

Set whether the stereochemistry is specified. Comparing a specified OBStereoBase derived class (or it's Config struct) with an unspecified one, always returns true.

bool IsSpecified (  ) const [inline]
Returns:
True if the stereochemistry is specified.
void SetAttribute ( const std::string &  v ) [inline, inherited]
virtual const std::string& GetAttribute (  ) const [inline, virtual, inherited]
Returns:
The attribute (key), which can be used to retrieve this data

Referenced by OBMoleculeFormat::MakeCombinedMolecule().

unsigned int GetDataType (  ) const [inline, inherited]
Returns:
the data type for this object as defined in OBGenericDataType
virtual const std::string& GetValue (  ) const [inline, virtual, inherited]

Base class returns a default value (the attribute type) but should never be called.

Reimplemented in OBCommentData, and OBPairData.

Referenced by OBDepict::DrawMolecule(), OBDescriptor::FilterCompare(), and OBDescriptor::GetValues().

virtual DataOrigin GetOrigin (  ) const [inline, virtual, inherited]

Member Data Documentation

std::string _attr [protected, inherited]

attribute tag (e.g., "UnitCell", "Comment" or "Author")

Referenced by OBRotamerList::Clone(), and OBNasaThermoData::OBNasaThermoData().

unsigned int _type [protected, inherited]

attribute type -- declared for each subclass

Referenced by OBRotamerList::Clone(), and OBNasaThermoData::OBNasaThermoData().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines