source: molecuilder/src/verbose.cpp@ 70b7aa

Last change on this file since 70b7aa was f92d00, checked in by Frederik Heber <heber@…>, 16 years ago

class molecule implementation split up into six separate parts.

  • dynamics: Verlet integration and constraint potential
  • fragmentation: BOSSANOVA scheme
  • geometry: all operations acting on the Vector's inside the atom's
  • graph: supplementary functions for fragmentation, treating molecule as a bonding graph
  • pointcloud: implementations of virtual functions for pointcloud class, needed for Tesselation
  • Property mode set to 100755
File size: 1.7 KB
Line 
1#include "molecule.hpp"
2
3/** Prints the tabs according to verbosity stored in the temporary constructed class.
4 * \param &ost stream to extend with tabs
5 * \return &ost stream with tabs
6 */
7ostream& Verbose::print (ostream &ost) const
8{
9 for (int i=Verbosity;i--;)
10 ost.put('\t');
11 //cout << "Verbose(.) called." << endl;
12 return ost;
13};
14
15/** Operator for the Verbose(arg) call.
16 * Constructs temporary a Verbose class object, wherein the verbosity is stored.
17 * Then << is called, which calls Verbose's print which adds the tabs and returns the stream.
18 * \param &ost stream to extend
19 * \param &m pointer to created Verbose object
20 * \return &ost
21 */
22ostream& operator<<(ostream& ost,const Verbose& m)
23{
24 return m.print(ost);
25};
26
27
28/** Prints the tabs according to verbosity stored in the temporary constructed class.
29 * Note that highest bit is set artificially to give number of bits to print
30 * \param &ost stream to extend with tabs
31 * \return &ost stream with tabs
32 */
33ostream& Binary::print (ostream &ost) const
34{
35 int bits = 1, counter = 1;
36 while ((bits = 1 << counter) < BinaryNumber)
37 counter++;
38 for (int i=0;i<counter-1;i++) {
39 if ((BinaryNumber & (1 << i)) == 0)
40 ost.put('0');
41 else
42 ost.put('1');
43 }
44 ost.put('b');
45 //cout << "Binary(.) called." << endl;
46 return ost;
47};
48
49/** Operator for the Binary(arg) call.
50 * Constructs temporary a Verbose class object, wherein the Binary is stored.
51 * Then << is called, which calls Binary's print which adds the tabs and returns the stream.
52 * \param &ost stream to extend
53 * \param &m pointer to created Binary object
54 * \return &ost
55 */
56ostream& operator<<(ostream& ost,const Binary& m)
57{
58 return m.print(ost);
59};
Note: See TracBrowser for help on using the repository browser.