Jint Class Reference

#include <Jint.h>

List of all members.

Public Member Functions

 Jint (JobC &jc)
virtual ~Jint ()
const MomNavigatorGetMom () const
JobCGetJobC () const
void Next (int n=1, const char *path_name=0)
void NextPass (int n=1, const char *path_name=0)
void Prev (int n=1, const char *path_name=0)
void Rerun (const char *path_name=0)
void GoTo (int run, int snarl)
void Run (int n=1, JobCPath::RunMode_t mode=JobCPath::kRunNin, const char *path_name=0)
const RegistryGetState ()

Public Attributes

SigC::Signal0< void > mom_modified
SigC::Signal0< void > job_modified

Private Member Functions

 Jint (const Jint &rhs)
Jintoperator= (const Jint &rhs)
void AddPath (JobCPath *jcp)
void RemovePath (JobCPath *jcp)
void UpdatePath (JobCPath *jcp, JobCPath::Update_t utype)
void StartPathRun (JobCPath *jcp)
void EndPathRun (JobCPath *jcp)

Private Attributes

JobCfJC
Registry fJobState
const char * fFirstPath

Detailed Description

Id
Jint.h,v 1.5 2005/07/21 20:26:36 bv Exp

Definition at line 28 of file Jint.h.


Constructor & Destructor Documentation

Jint::Jint ( JobC jc  ) 

Definition at line 19 of file Jint.cxx.

References AddPath(), chirp(), fJC, fJobState, JobCPathRegistry::GetPathBegin(), JobCPathRegistry::GetPathEnd(), JobCPathModule::GetPathRegistry(), JobC::Input, JobC::Path, Registry::Set(), JobCInput::SigGet, JobCInput::SigGoTo, JobCInput::SigNext, and JobCInput::SigPrev.

00020     : fJC(jc)
00021       ,fJobState(false)
00022       ,fFirstPath(0)
00023 {
00024     fJobState.SetName("Job State");
00025     Registry paths(false);      // holds all existing paths
00026     paths.SetName("Paths");
00027     fJobState.Set("paths",paths);
00028 
00029     const JobCPathRegistry* jcpr = fJC.Path.GetPathRegistry();
00030     if (!jcpr) {
00031         cerr << "Jint: no JobCPathRegistry, I may miss some paths\n";
00032     }
00033     else {
00034         JobCPathRegistry::PathIterator pit, end = jcpr->GetPathEnd();
00035         for (pit = jcpr->GetPathBegin(); pit != end; ++pit) 
00036             this->AddPath(*pit);
00037     }
00038 
00039     fJC.Path.SigNewPath.connect(slot(*this,&Jint::AddPath));
00040 
00041     // Connect to I/O sigs
00042     fJC.Input.SigGet.connect(bind(slot(chirp),"Get"));
00043     fJC.Input.SigNext.connect(bind(slot(chirp),"Next"));
00044     fJC.Input.SigPrev.connect(bind(slot(chirp),"Prev"));
00045     fJC.Input.SigGoTo.connect(bind(slot(chirp),"GoTo"));
00046 }

Jint::~Jint ( void   )  [virtual]

Definition at line 48 of file Jint.cxx.

00049 {
00050 }

Jint::Jint ( const Jint rhs  )  [private]

Member Function Documentation

void Jint::AddPath ( JobCPath jcp  )  [private]

Definition at line 52 of file Jint.cxx.

References EndPathRun(), fFirstPath, fJobState, Registry::Get(), JobCPath::GetName(), job_modified, RemovePath(), Registry::Set(), StartPathRun(), and UpdatePath().

Referenced by Jint().

00053 {
00054     Registry paths;
00055     bool ok = fJobState.Get("paths",paths);
00056     if (!ok) {
00057         cerr << "Jint::AddPath - no paths in JobState!\n";
00058         return;
00059     }
00060     cerr << "Jint::AddPath: \"" << jcp->GetName() << "\" added\n";
00061 
00062     if (!fFirstPath) fFirstPath = jcp->GetName();
00063         
00064     Registry path(false);       // holds info about this path.
00065     paths.Set(jcp->GetName(),path);
00066     fJobState.Set("paths",paths);
00067 
00068     // Connect to this JCP's signals
00069     jcp->SigDelete.connect(slot(*this,&Jint::RemovePath));
00070     jcp->SigUpdate.connect(slot(*this,&Jint::UpdatePath));
00071     jcp->SigStartRun.connect(slot(*this,&Jint::StartPathRun));
00072     jcp->SigEndRun.connect(slot(*this,&Jint::EndPathRun));
00073 
00074     job_modified.emit();
00075 }

void Jint::EndPathRun ( JobCPath jcp  )  [private]

Definition at line 93 of file Jint.cxx.

References JobCResult::EndOfInputStream(), JobCPath::GetName(), JobCPath::LastResult(), and mom_modified.

Referenced by AddPath().

00094 {
00095 //    cerr << "Path: " << jcp->GetName() << " ended a run\n";
00096     if (jcp->LastResult().EndOfInputStream()) {
00097         cerr << "Path: " << jcp->GetName() << " end of input stream\n";
00098         return;
00099     }
00100     mom_modified();
00101 }

JobC& Jint::GetJobC (  )  const [inline]

Definition at line 37 of file Jint.h.

References fJC.

Referenced by Mint::GetJobC().

00037 { return fJC; };

const MomNavigator * Jint::GetMom (  )  const
const Registry& Jint::GetState (  )  [inline]

Definition at line 49 of file Jint.h.

References fJobState.

00049 { return fJobState; }

void Jint::GoTo ( int  run,
int  snarl 
)

Definition at line 166 of file Jint.cxx.

References fFirstPath, fJC, JobCInput::GoTo(), JobC::Input, and JobC::Path.

Referenced by Mint::GoTo(), RunSnarlEntry::RSEntryHandler(), and TridPageDisplay::RunSnarlEntryHandler().

00167 {
00168     fJC.Input.GoTo(run,snarl);
00169     fJC.Path(fFirstPath).Run(0);
00170 }

void Jint::Next ( int  n = 1,
const char *  path_name = 0 
)

Definition at line 110 of file Jint.cxx.

References fFirstPath, fJC, JobC::Input, JobCInput::Next(), and JobC::Path.

Referenced by TridPageDisplay::JumpEntryHandler(), Mint::Next(), and RunSnarlEntry::RunningEntryHandler().

00111 {
00112     if (path_name) {
00113         cerr << "Jint: Next on path \"" << path_name << "\"\n";
00114         fJC.Input.Next(n);
00115         fJC.Path(path_name).Run(0);
00116         return;
00117     }
00118 
00119     if (!fFirstPath) {
00120         cerr << "Jint:: no paths created yet\n";
00121         return;
00122     }
00123     fJC.Input.Next(n);
00124     fJC.Path(fFirstPath).Run(0);
00125 }

void Jint::NextPass ( int  n = 1,
const char *  path_name = 0 
)

Definition at line 126 of file Jint.cxx.

References fFirstPath, fJC, and JobC::Path.

Referenced by Mint::NextPass().

00127 {
00128     if (!path_name && !fFirstPath) {
00129         cerr << "Jint::NextPass no path name given and not default\n";
00130         return;
00131     }
00132 
00133     if (!path_name) path_name = fFirstPath;
00134 
00135     fJC.Path(path_name).RunNpass(n);
00136 }

Jint& Jint::operator= ( const Jint rhs  )  [private]
void Jint::Prev ( int  n = 1,
const char *  path_name = 0 
)

Definition at line 137 of file Jint.cxx.

References fFirstPath, fJC, JobC::Input, JobC::Path, and JobCInput::Prev().

Referenced by TridPageDisplay::JumpEntryHandler(), Mint::Prev(), and RunSnarlEntry::RunningEntryHandler().

00138 {
00139     if (path_name) {
00140         fJC.Input.Prev(n);
00141         fJC.Path(path_name).Run(0);
00142         return;
00143     }
00144 
00145     if (!fFirstPath) {
00146         cerr << "Jint:: no paths created yet\n";
00147         return;
00148     }
00149     fJC.Input.Prev(n);
00150     fJC.Path(fFirstPath).Run(0);
00151 }

void Jint::RemovePath ( JobCPath jcp  )  [private]

Definition at line 77 of file Jint.cxx.

References JobCPath::GetName().

Referenced by AddPath().

00078 {
00079     cerr << "Path: " << jcp->GetName() << " removed\n";
00080 }

void Jint::Rerun ( const char *  path_name = 0  ) 

Definition at line 152 of file Jint.cxx.

References fFirstPath, fJC, and JobC::Path.

00153 {
00154     if (path_name) {
00155         fJC.Path(path_name).Run(0);
00156         return;
00157     }
00158 
00159     if (!fFirstPath) {
00160         cerr << "Jint:: no paths created yet\n";
00161         return;
00162     }
00163 
00164     fJC.Path(fFirstPath).Run(0);
00165 }

void Jint::Run ( int  n = 1,
JobCPath::RunMode_t  mode = JobCPath::kRunNin,
const char *  path_name = 0 
)

Definition at line 171 of file Jint.cxx.

References fFirstPath, fJC, and JobC::Path.

Referenced by RunSnarlEntry::RunningEntryHandler().

00172 {
00173     if (path_name) {
00174         fJC.Path(path_name).Run(n,mode);
00175         return;
00176     }
00177 
00178     if (!fFirstPath) {
00179         cerr << "Jint:: no paths created yet\n";
00180         return;
00181     }
00182 
00183     fJC.Path(fFirstPath).Run(n,mode);
00184 }

void Jint::StartPathRun ( JobCPath jcp  )  [private]

Definition at line 87 of file Jint.cxx.

Referenced by AddPath().

00088 {
00089 //    cerr << "Path: " << jcp->GetName() << " started a run\n";
00090 //    cerr << "  State of job:\n  " << fJobState << endl;
00091 }

void Jint::UpdatePath ( JobCPath jcp,
JobCPath::Update_t  utype 
) [private]

Definition at line 82 of file Jint.cxx.

References JobCPath::GetName().

Referenced by AddPath().

00083 {
00084     cerr << "Path: " << jcp->GetName() << " updated by: " << utype << endl;
00085 }


Member Data Documentation

const char* Jint::fFirstPath [private]

Definition at line 71 of file Jint.h.

Referenced by AddPath(), GoTo(), Next(), NextPass(), Prev(), Rerun(), and Run().

JobC& Jint::fJC [private]

Definition at line 69 of file Jint.h.

Referenced by GetJobC(), GetMom(), GoTo(), Jint(), Next(), NextPass(), Prev(), Rerun(), and Run().

Definition at line 70 of file Jint.h.

Referenced by AddPath(), GetState(), and Jint().

SigC::Signal0<void> Jint::job_modified

Definition at line 52 of file Jint.h.

Referenced by AddPath().

SigC::Signal0<void> Jint::mom_modified

Definition at line 51 of file Jint.h.

Referenced by EndPathRun(), Mint::SpawnDisplay(), TestMCTree::SpawnMCTree(), and TridSetup().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1