<commit_before>// $Id: system.C,v 1.6 2000/02/23 07:53:24 oliver Exp $

#include <BALL/KERNEL/system.h>

#include <BALL/KERNEL/global.h>
#include <BALL/KERNEL/molecule.h>
#include <BALL/KERNEL/fragment.h>
#include <BALL/KERNEL/protein.h>

using namespace std;

namespace BALL 
{

	System::System()
		:	BaseFragment()
	{
	}
		
	System::System(const System& system,bool deep)
	{
		set(system, deep);
	}
		
	System::System(const String& name)
		:	BaseFragment(name)
	{
	}

  void System::persistentWrite(PersistenceManager& pm, const char* name) const
  {
    pm.writeObjectHeader(this, name);
      BaseFragment::persistentWrite(pm);
    pm.writeObjectTrailer(name);
	}

  void System::persistentRead(PersistenceManager& pm)
  {
    pm.checkObjectHeader(RTTI::getStreamName<BaseFragment>());
			Composite::persistentRead(pm);
    pm.checkObjectTrailer(0);
	}
 

	System::~System()
	{
		destroy();
	}

	void System::clear()
	{
		BaseFragment::clear();
	}
		
	void System::destroy()
	{
		BaseFragment::destroy();
	}
		
	void System::set(const System& system, bool deep)
	{
		BaseFragment::set(system, deep);
	}
			
	System& System::operator = (const System& system)
	{
		BaseFragment::set(system);

		return *this;
	}

	void System::get(System& system, bool deep) const
	{
		system.set(*this, deep);
	}
			
	void System::swap(System& system)
	{
		BaseFragment::swap(system);
	}

	Size System::countMolecules() const
	{
		Size size = 0;

		for (MoleculeIterator mol_it = beginMolecule(); !mol_it.isEnd(); ++mol_it)
		{
			++size;
		}

		return size;
	}

	Size  System::countFragments() const
	{
		Size size = 0;

		for (FragmentIterator frag_it = beginFragment(); !frag_it.isEnd(); ++frag_it)
		{
			++size;
		}

		return size;
	}

	Size System::countAtoms() const
	{
		Size size = 0;

		for (AtomIterator atom_it = beginAtom(); !atom_it.isEnd(); ++atom_it)
		{
			++size;
		}

		return size;
	}

	void System::prepend(Molecule& molecule)
	{
		Composite::prependChild(molecule);
	}

	void System::append(Molecule& molecule)
	{
		Composite::appendChild(molecule);
	}

	void System::insert(Molecule& molecule)
	{
		append(molecule);
	}

	void System::insertBefore(Molecule& molecule, Composite& before)
	{
		before.Composite::insertBefore(molecule);
	}

	void System::insertAfter(Molecule& molecule, Composite& after)
	{
		after.Composite::insertAfter(molecule);
	}

	bool System::remove(Molecule& molecule)
	{
		return Composite::removeChild(molecule);
	}

	void System::spliceBefore(System& system)
	{
		Composite::spliceBefore(system);
	}

	void System::spliceAfter(System& system)
	{
		Composite::spliceAfter(system);
	}

	void System::splice(System& system)
	{
		Composite::splice(system);
	}

	void System::destroyBonds()
	{
		for (AtomIterator atom_it = beginAtom(); !atom_it.isEnd(); ++atom_it)
		{
			atom_it->destroyBonds();
		}
	}

	bool System::isValid() const
	{ 
		return BaseFragment::isValid();
	}

	void System::dump(ostream& s, Size depth) const
	{
		BALL_DUMP_STREAM_PREFIX(s);
		
		BaseFragment::dump(s, depth);

		BALL_DUMP_STREAM_SUFFIX(s);
	}

	void System::read(istream& /* s */)
	{
		throw Exception::NotImplemented(__FILE__, __LINE__);
	}

	void System::write(ostream& /* s */) const
	{
		throw Exception::NotImplemented(__FILE__, __LINE__);
	}
} // namespace BALL
<commit_msg>fixed: warning due to unused variable in DUMP macro<commit_after>// $Id: system.C,v 1.7 2000/03/03 08:04:36 oliver Exp $

#include <BALL/KERNEL/system.h>

#include <BALL/KERNEL/global.h>
#include <BALL/KERNEL/molecule.h>
#include <BALL/KERNEL/fragment.h>
#include <BALL/KERNEL/protein.h>

using namespace std;

namespace BALL 
{

	System::System()
		:	BaseFragment()
	{
	}
		
	System::System(const System& system,bool deep)
	{
		set(system, deep);
	}
		
	System::System(const String& name)
		:	BaseFragment(name)
	{
	}

  void System::persistentWrite(PersistenceManager& pm, const char* name) const
  {
    pm.writeObjectHeader(this, name);
      BaseFragment::persistentWrite(pm);
    pm.writeObjectTrailer(name);
	}

  void System::persistentRead(PersistenceManager& pm)
  {
    pm.checkObjectHeader(RTTI::getStreamName<BaseFragment>());
			Composite::persistentRead(pm);
    pm.checkObjectTrailer(0);
	}
 

	System::~System()
	{
		destroy();
	}

	void System::clear()
	{
		BaseFragment::clear();
	}
		
	void System::destroy()
	{
		BaseFragment::destroy();
	}
		
	void System::set(const System& system, bool deep)
	{
		BaseFragment::set(system, deep);
	}
			
	System& System::operator = (const System& system)
	{
		BaseFragment::set(system);

		return *this;
	}

	void System::get(System& system, bool deep) const
	{
		system.set(*this, deep);
	}
			
	void System::swap(System& system)
	{
		BaseFragment::swap(system);
	}

	Size System::countMolecules() const
	{
		Size size = 0;

		for (MoleculeIterator mol_it = beginMolecule(); !mol_it.isEnd(); ++mol_it)
		{
			++size;
		}

		return size;
	}

	Size  System::countFragments() const
	{
		Size size = 0;

		for (FragmentIterator frag_it = beginFragment(); !frag_it.isEnd(); ++frag_it)
		{
			++size;
		}

		return size;
	}

	Size System::countAtoms() const
	{
		Size size = 0;

		for (AtomIterator atom_it = beginAtom(); !atom_it.isEnd(); ++atom_it)
		{
			++size;
		}

		return size;
	}

	void System::prepend(Molecule& molecule)
	{
		Composite::prependChild(molecule);
	}

	void System::append(Molecule& molecule)
	{
		Composite::appendChild(molecule);
	}

	void System::insert(Molecule& molecule)
	{
		append(molecule);
	}

	void System::insertBefore(Molecule& molecule, Composite& before)
	{
		before.Composite::insertBefore(molecule);
	}

	void System::insertAfter(Molecule& molecule, Composite& after)
	{
		after.Composite::insertAfter(molecule);
	}

	bool System::remove(Molecule& molecule)
	{
		return Composite::removeChild(molecule);
	}

	void System::spliceBefore(System& system)
	{
		Composite::spliceBefore(system);
	}

	void System::spliceAfter(System& system)
	{
		Composite::spliceAfter(system);
	}

	void System::splice(System& system)
	{
		Composite::splice(system);
	}

	void System::destroyBonds()
	{
		for (AtomIterator atom_it = beginAtom(); !atom_it.isEnd(); ++atom_it)
		{
			atom_it->destroyBonds();
		}
	}

	bool System::isValid() const
	{ 
		return BaseFragment::isValid();
	}

	void System::dump(ostream& s, Size depth) const
	{
		BaseFragment::dump(s, depth);
	}

	void System::read(istream& /* s */)
	{
		throw Exception::NotImplemented(__FILE__, __LINE__);
	}

	void System::write(ostream& /* s */) const
	{
		throw Exception::NotImplemented(__FILE__, __LINE__);
	}
} // namespace BALL

{'fraction_non_alphanumeric': 0.15214742613463295, 'fraction_numerical': 0.006091989034419738, 'mean_word_length': 4.3433685923515055, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, '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': '3790824', 'n_tokens_mistral': 2650, 'n_tokens_neox': 2380, 'n_words': 432}