Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Delays Class Reference

#include <Delays.h>

Collaboration diagram for Delays:

Collaboration graph
[legend]
List of all members.

Public Methods

 Delays (Config &cfg)
string operator() (int idx_, const string &infile_) const

Private Attributes

Configm_config
bool m_is_rel [2]
string m_delay [2]

Constructor & Destructor Documentation

Delays::Delays Config   cfg
 

Definition at line 22 of file Delays.cpp.

References Config::get_post_delay, Config::get_pre_delay, m_config, m_delay, and m_is_rel.

00023     : m_config (cfg_)
00024 {
00025     string::size_type idx;
00026     string raw_delay [2];
00027     raw_delay [0] = m_config.get_pre_delay ();
00028     raw_delay [1] = m_config.get_post_delay ();
00029     m_is_rel [0] = false; 
00030     m_is_rel [1] = false;
00031 
00032     DL((TRACE,"raw_delay[0] = \"%s\"\n",raw_delay[0].c_str ()));
00033     DL((TRACE,"raw_delay[1] = \"%s\"\n",raw_delay[1].c_str ()));
00034 
00035     for (int i = 0; i < 2; i++) {
00036         if ((idx = raw_delay [i].find ('x')) == string::npos) {   // seconds
00037             m_delay [i] = "--duration=" + raw_delay [i].substr (0, idx);
00038         }
00039         else {                                               // relative
00040             m_delay [i] = "--multiplier=" + raw_delay [i].substr (0, idx);
00041             m_is_rel [i] = true;
00042         }
00043     }
00044     
00045     DL((TRACE,"m_delay[0] = \"%s\" (%s)\n",
00046         m_delay[0].c_str (), m_is_rel [0] ? "relative" : "seconds"));
00047     DL((TRACE,"m_delay[1] = \"%s\" (%s)\n",
00048         m_delay[1].c_str (), m_is_rel [1] ? "relative" : "seconds"));
00049 }


Member Function Documentation

string Delays::operator() int    idx_,
const string &    infile_
const
 

Definition at line 53 of file Delays.cpp.

References m_delay, and m_is_rel.

00054 {
00055     if (idx_ >= 0 && idx_ < 2) {
00056         if (m_is_rel [idx_]) {
00057             return m_delay [idx_] + " --input-file=" + infile_;
00058         }
00059         return m_delay [idx_];
00060     }
00061     else {
00062         return "";
00063     }
00064 }


Member Data Documentation

Config& Delays::m_config [private]
 

Definition at line 31 of file Delays.h.

Referenced by Delays.

string Delays::m_delay[2] [private]
 

Definition at line 33 of file Delays.h.

Referenced by Delays, and operator().

bool Delays::m_is_rel[2] [private]
 

Definition at line 32 of file Delays.h.

Referenced by Delays, and operator().


The documentation for this class was generated from the following files:
Generated on Tue Feb 11 23:05:32 2003 for gwavmerger by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002