Open Babel  3.0
Public Member Functions | Protected Attributes | List of all members
OBStereoBase Class Referenceabstract

#include <openbabel/stereo/stereo.h>

Inheritance diagram for OBStereoBase:
OBGenericData OBTetraNonPlanarStereo OBTetraPlanarStereo OBTetrahedralStereo OBCisTransStereo OBSquarePlanarStereo

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()

OBStereoBase ( OBMol mol)
inline

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

Parameters
molThe molecule.

◆ ~OBStereoBase()

virtual ~OBStereoBase ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ GetMolecule()

OBMol* GetMolecule ( ) const
inline

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

◆ GetType()

virtual OBStereo::Type GetType ( ) const
pure virtual

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

Implemented in OBCisTransStereo, OBTetrahedralStereo, and OBSquarePlanarStereo.

◆ SetSpecified()

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.

◆ IsSpecified()

bool IsSpecified ( ) const
inline
Returns
True if the stereochemistry is specified.

◆ Clone()

virtual OBGenericData* Clone ( OBBase ) const
inlinevirtualinherited

◆ SetAttribute()

void SetAttribute ( const std::string &  v)
inlineinherited

◆ SetOrigin()

void SetOrigin ( const DataOrigin  s)
inlineinherited

◆ GetAttribute()

virtual const std::string& GetAttribute ( ) const
inlinevirtualinherited
Returns
The attribute (key), which can be used to retrieve this data

Referenced by OpenBabel::extract_thermochemistry(), and OBMoleculeFormat::MakeCombinedMolecule().

◆ GetDataType()

unsigned int GetDataType ( ) const
inlineinherited
Returns
the data type for this object as defined in OBGenericDataType

◆ GetValue()

virtual const std::string& GetValue ( ) const
inlinevirtualinherited

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

Reimplemented in OBPairData, and OBCommentData.

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

◆ GetOrigin()

virtual DataOrigin GetOrigin ( ) const
inlinevirtualinherited

Member Data Documentation

◆ _attr

std::string _attr
protectedinherited

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

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

◆ _type

unsigned int _type
protectedinherited

attribute type – declared for each subclass

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

◆ _source

DataOrigin _source
protectedinherited

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