Loading...
Searching...
No Matches
BALL::SmartsParser::SPAtom Class Reference

Smarts Parser Atom class. More...

`#include <BALL/STRUCTURE/smartsParser.h>`

## Classes

union | PropertyValue
| possible types of the properties More...
struct | Property
| Property struct of smarts parser atom. More...

## Public Types

enum | PropertyType { ISOTOPE = 1 , CHARGE , AROMATIC , ALIPHATIC , IN_NUM_RINGS , IN_RING_SIZE , IN_BRACKETS , CONNECTED , EXPLICIT_HYDROGENS , VALENCE , IMPLICIT_HYDROGENS , DEGREE , RING_CONNECTED , CHIRALITY , SYMBOL }
| enum of all properties possible for a smarts parser atom More...

## Public Member Functions

Constructors and destructors

Common properties are:

bool is_not Size isotope bool not_isotope Index charge bool not_charge bool is_aromatic bool not_aromatic bool aliphatic bool not_aliphatic Index in_num_rings bool not_in_num_rings bool in_brackets Index in_ring_size bool not_in_ring_size Size connected bool not_connected_to Size explicit_hydrogens bool not_explicit_hydrogens Size valence bool not_valence Size implicit_hydrogens bool not_implicit_hydrogens Size degree bool not_degree Size ring_connected bool not_ring_connected bool not_chirality String symbol

all this properties can be set

| SPAtom ()
| Default constructor.
| SPAtom (const String &symbol)
| copy constructor
virtual | ~SPAtom ()
| destructor
Accessors
void | setProperty (PropertyType type, int int_value)
| sets an int property
void | setProperty (PropertyType type, bool flag)
| sets a flag
void | setProperty (PropertyType type, const Element *element)
| sets a Element
void | setProperty (PropertyType type, ChiralClass chirality)
| sets a chirality value
void | setProperty (Property property)
| sets a property
void | addPropertiesFromSPAtom (SPAtom *sp_atom)
| adds properties from another SPAtom
void | setNotProperty (PropertyType type)
| negotiates the property definition
bool | hasProperty (PropertyType type) const
| returns true if the property is set
PropertyValue | getProperty (PropertyType type)
| returns a value of the given property type
Size | countProperties () const
| returns the number of properties
Size | getDefaultValence (const Atom *atom) const
| return the number of valences of the given atom
Size | countRealValences (const Atom *atom) const
| returns the number of available valences of the given atom
Size | getNumberOfImplicitHydrogens (const Atom *atom) const
| returns the number of implicit hydrogens of the given atom

## Predicates

Atom * | atom_
| the atom which this sp_atom belongs to
std::map< PropertyType, PropertyValue > | properties_
| the properties of this SPAtom
std::set< PropertyType > | not_properties_
| the properties which are negated
bool | equals (const Atom *atom) const
| returns true if the local properties of the atoms match

## Detailed Description

Smarts Parser Atom class.

This class implements the representation of a atom of the smarts parser. It is faster than using the BALL Atom class with Properties. As all the possible properties are known from the definition of the SMARTS language, the properties are listed within the enumeration.

Definition at line 188 of file smartsParser.h.

## Member Enumeration Documentation

## PropertyType

enum BALL::SmartsParser::SPAtom::PropertyType

enum of all properties possible for a smarts parser atom

Enumerator
ISOTOPE |
CHARGE |
AROMATIC |
ALIPHATIC |
IN_NUM_RINGS |
IN_RING_SIZE |
IN_BRACKETS |
CONNECTED |
EXPLICIT_HYDROGENS |
VALENCE |
IMPLICIT_HYDROGENS |
DEGREE |
RING_CONNECTED |
CHIRALITY |
SYMBOL |

Definition at line 193 of file smartsParser.h.

## Constructor & Destructor Documentation

## SPAtom() [1/2]

BALL::SmartsParser::SPAtom::SPAtom | ( |  | ) |

Default constructor.

## SPAtom() [2/2]

BALL::SmartsParser::SPAtom::SPAtom | ( | const String & | symbol | ) |

copy constructor

## ~SPAtom()

virtual BALL::SmartsParser::SPAtom::~SPAtom | ( |  | ) |

virtual

destructor

## Member Function Documentation

## addPropertiesFromSPAtom()

void BALL::SmartsParser::SPAtom::addPropertiesFromSPAtom | ( | SPAtom * | sp_atom | ) |

adds properties from another SPAtom

## countProperties()

Size BALL::SmartsParser::SPAtom::countProperties | ( |  | ) | const

returns the number of properties

## countRealValences()

Size BALL::SmartsParser::SPAtom::countRealValences | ( | const Atom * | atom | ) | const

returns the number of available valences of the given atom

## equals()

bool BALL::SmartsParser::SPAtom::equals | ( | const Atom * | atom | ) | const

returns true if the local properties of the atoms match

## getDefaultValence()

Size BALL::SmartsParser::SPAtom::getDefaultValence | ( | const Atom * | atom | ) | const

return the number of valences of the given atom

## getNumberOfImplicitHydrogens()

Size BALL::SmartsParser::SPAtom::getNumberOfImplicitHydrogens | ( | const Atom * | atom | ) | const

returns the number of implicit hydrogens of the given atom

## getProperty()

PropertyValue BALL::SmartsParser::SPAtom::getProperty | ( | PropertyType | type | ) |

returns a value of the given property type

## hasProperty()

bool BALL::SmartsParser::SPAtom::hasProperty | ( | PropertyType | type | ) | const

returns true if the property is set

## setNotProperty()

void BALL::SmartsParser::SPAtom::setNotProperty | ( | PropertyType | type | ) |

negotiates the property definition

## setProperty() [1/5]

void BALL::SmartsParser::SPAtom::setProperty | ( | Property | property | ) |

sets a property

## setProperty() [2/5]

void BALL::SmartsParser::SPAtom::setProperty | ( | PropertyType | type,
|  | bool | flag )

sets a flag

## setProperty() [3/5]

void BALL::SmartsParser::SPAtom::setProperty | ( | PropertyType | type,
|  | ChiralClass | chirality )

sets a chirality value

## setProperty() [4/5]

void BALL::SmartsParser::SPAtom::setProperty | ( | PropertyType | type,
|  | const Element * | element )

sets a Element

## setProperty() [5/5]

void BALL::SmartsParser::SPAtom::setProperty | ( | PropertyType | type,
|  | int | int_value )

sets an int property

## Member Data Documentation

## atom_

Atom* BALL::SmartsParser::SPAtom::atom_

protected

the atom which this sp_atom belongs to

Definition at line 371 of file smartsParser.h.

## not_properties_

std::set<PropertyType> BALL::SmartsParser::SPAtom::not_properties_

protected

the properties which are negated

Definition at line 377 of file smartsParser.h.

## properties_

std::map<PropertyType, PropertyValue> BALL::SmartsParser::SPAtom::properties_

protected

the properties of this SPAtom

Definition at line 374 of file smartsParser.h.