<commit_before>// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: bond.h,v 1.30 2002/12/12 09:48:45 oliver Exp $

#ifndef BALL_KERNEL_BOND_H
#define BALL_KERNEL_BOND_H

#ifndef BALL_COMMON_H
#	include <BALL/common.h>
#endif

#ifndef BALL_CONCEPT_PROPERTY_H
#	include <BALL/CONCEPT/property.h>
#endif

#ifndef BALL_CONCEPT_COMPOSITE_H
#	include <BALL/CONCEPT/composite.h>
#endif

#ifndef BALL_CONCEPT_ATOMCONTAINER_H
#	include <BALL/KERNEL/atomContainer.h>
#endif

#ifndef BALL_DATATYPE_STRING_H
#	include <BALL/DATATYPE/string.h>
#endif


#define BALL_BOND_DEFAULT_FIRST_ATOM    0
#define BALL_BOND_DEFAULT_SECOND_ATOM   0
#define BALL_BOND_DEFAULT_NAME          ""
#define BALL_BOND_DEFAULT_ORDER         ORDER__UNKNOWN
#define BALL_BOND_DEFAULT_TYPE          TYPE__UNKNOWN


namespace BALL 
{

	class Atom;
	class Fragment;
	class System;

	/** Bond class.
			An instance of Bond represents a bond between two atoms.
			Bond equality is defined as bond identity.
			A linear ordering of bonds is defined as the linear order of the \Ref{Object::Handle}s.
			There can be only one bond between two atoms (double, triple, etc. bonds are represented
			using just one bond and an appropriate value for the bond order attribute, see \Ref{setBondOrder}).
			\\
			The "first" and "second" atom are assigned in a unique way: the first atom is always
			the atom with the lower \Ref{Handle} thant the second atom.
			\\
			The "state" of a bond is defined by its attributes:
			\begin{itemize}
				\item "first atom" (\Ref{Bond::first_})
				\item "second atom" (\Ref{Bond::second_})
				\item "bond name" (\Ref{Bond::name_})
				\item "bond order" (\Ref{Bond::bond_order_})
				\item "bond type" (\Ref{Bond::bond_type_})
			\end{itemize}
			{\bf Definition:} \URL{BALL/KERNEL/bond.h}\\
	*/
	class Bond
		: public Composite,
			public PropertyManager
	{
		public:

		///
		friend class Atom;

		BALL_CREATE_DEEP(Bond)

		/**	@name	Exceptions
		*/
		//@{
			
		/**	Too many bonds created.
				This exception may be thrown by \Ref{createBond} if the maximum number
				of bonds (8 bonds) is exceeded.
		*/
		class TooManyBonds
			:	public	Exception::GeneralException
		{
			public:
			TooManyBonds(const char* file, int line)
				throw();
		};

		/**	Not bound to two atoms.
				This exception may be thrown by \Ref{getLength} if this instance is not bound.
		*/
		class NotBound
			:	public	Exception::GeneralException
		{
			public:
			NotBound(const char* file, int line)
				throw();
		};<commit_msg>changed: TooManyBonds exception now prints which atoms it didn't like.<commit_after>// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: bond.h,v 1.31 2003/02/08 16:12:27 oliver Exp $

#ifndef BALL_KERNEL_BOND_H
#define BALL_KERNEL_BOND_H

#ifndef BALL_COMMON_H
#	include <BALL/common.h>
#endif

#ifndef BALL_CONCEPT_PROPERTY_H
#	include <BALL/CONCEPT/property.h>
#endif

#ifndef BALL_CONCEPT_COMPOSITE_H
#	include <BALL/CONCEPT/composite.h>
#endif

#ifndef BALL_CONCEPT_ATOMCONTAINER_H
#	include <BALL/KERNEL/atomContainer.h>
#endif

#ifndef BALL_DATATYPE_STRING_H
#	include <BALL/DATATYPE/string.h>
#endif


#define BALL_BOND_DEFAULT_FIRST_ATOM    0
#define BALL_BOND_DEFAULT_SECOND_ATOM   0
#define BALL_BOND_DEFAULT_NAME          ""
#define BALL_BOND_DEFAULT_ORDER         ORDER__UNKNOWN
#define BALL_BOND_DEFAULT_TYPE          TYPE__UNKNOWN


namespace BALL 
{

	class Atom;
	class Fragment;
	class System;

	/** Bond class.
			An instance of Bond represents a bond between two atoms.
			Bond equality is defined as bond identity.
			A linear ordering of bonds is defined as the linear order of the \Ref{Object::Handle}s.
			There can be only one bond between two atoms (double, triple, etc. bonds are represented
			using just one bond and an appropriate value for the bond order attribute, see \Ref{setBondOrder}).
			\\
			The "first" and "second" atom are assigned in a unique way: the first atom is always
			the atom with the lower \Ref{Handle} thant the second atom.
			\\
			The "state" of a bond is defined by its attributes:
			\begin{itemize}
				\item "first atom" (\Ref{Bond::first_})
				\item "second atom" (\Ref{Bond::second_})
				\item "bond name" (\Ref{Bond::name_})
				\item "bond order" (\Ref{Bond::bond_order_})
				\item "bond type" (\Ref{Bond::bond_type_})
			\end{itemize}
			{\bf Definition:} \URL{BALL/KERNEL/bond.h}\\
	*/
	class Bond
		: public Composite,
			public PropertyManager
	{
		public:

		///
		friend class Atom;

		BALL_CREATE_DEEP(Bond)

		/**	@name	Exceptions
		*/
		//@{
			
		/**	Too many bonds created.
				This exception may be thrown by \Ref{createBond} if the maximum number
				of bonds (8 bonds) is exceeded.
		*/
		class TooManyBonds
			:	public	Exception::GeneralException
		{
			public:
			TooManyBonds(const char* file, int line)
				throw();
			TooManyBonds(const char* file, int line, const Atom& atom1, const Atom& atom2)
				throw();
		};

		/**	Not bound to two atoms.
				This exception may be thrown by \Ref{getLength} if this instance is not bound.
		*/
		class NotBound
			:	public	Exception::GeneralException
		{
			public:
			NotBound(const char* file, int line)
				throw();
		};
{'fraction_non_alphanumeric': 0.10599613152804642, 'fraction_numerical': 0.008897485493230174, 'mean_word_length': 3.3896434634974533, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2853482', 'n_tokens_mistral': 2038, 'n_tokens_neox': 1785, 'n_words': 549}