#include "TObjArray.h"
#include "TObjString.h"
#include "TProofNodeInfo.h"
ClassImp(TProofNodeInfo)
#define PNISETANY(a) \
  { if (os->String() != "-") { a; } \
    if (!(os = (TObjString *) nxos())) return; }
#define PNISETSTRING(s) PNISETANY(s = os->GetName())
#define PNISETINT(i) PNISETANY(i = os->String().Atoi())
TProofNodeInfo::TProofNodeInfo():
   fNodeType(kWorker),
   fPort(-1),
   fPerfIndex(100)
{
   
}
TProofNodeInfo::TProofNodeInfo(const char *str)
               : fNodeType(kWorker), fPort(-1), fPerfIndex(100)
{
   
   
   
   
   if (!str || strlen(str) <= 0)
      return;
   
   TString ss(str);
   TObjArray *oa = ss.Tokenize("|");
   if (!oa)
      return;
   TIter nxos(oa);
   TObjString *os = (TObjString *) nxos();
   if (!os)
      return;
   
   PNISETANY(fNodeType = GetNodeType(os->GetName()));
   
   PNISETSTRING(fNodeName);
   
   fImage = fNodeName;
   fImage.Remove(0, fImage.Index("@")+1);
   
   PNISETINT(fPort);
   
   PNISETSTRING(fOrdinal);
   
   PNISETSTRING(fId);
   
   PNISETINT(fPerfIndex);
   
   PNISETSTRING(fImage);
   
   PNISETSTRING(fWorkDir);
   
   PNISETSTRING(fMsd);
   
   PNISETSTRING(fConfig);
}
TProofNodeInfo::TProofNodeInfo(const TProofNodeInfo &nodeInfo) : TObject(nodeInfo)
{
   
   fNodeType  = nodeInfo.fNodeType;
   fNodeName  = nodeInfo.fNodeName;
   fWorkDir   = nodeInfo.fWorkDir;
   fOrdinal   = nodeInfo.fOrdinal;
   fImage     = nodeInfo.fImage;
   fId        = nodeInfo.fId;
   fConfig    = nodeInfo.fConfig;
   fMsd       = nodeInfo.fMsd;
   fPort      = nodeInfo.fPort;
   fPerfIndex = nodeInfo.fPerfIndex;
}
void TProofNodeInfo::Assign(const TProofNodeInfo &n)
{
   
   fNodeType  = n.fNodeType;
   fNodeName  = n.fNodeName;
   fWorkDir   = n.fWorkDir;
   fOrdinal   = n.fOrdinal;
   fImage     = n.fImage;
   fId        = n.fId;
   fConfig    = n.fConfig;
   fMsd       = n.fMsd;
   fPort      = n.fPort;
   fPerfIndex = n.fPerfIndex;
}
void TProofNodeInfo::Print(const Option_t *) const
{
   
   Printf("fNodeType:  %d", fNodeType);
   Printf("fNodeName:  %s", fNodeName.Data());
   Printf("fWorkDir:   %s", fWorkDir.Data());
   Printf("fOrdinal:   %s", fOrdinal.Data());
   Printf("fImage:     %s", fImage.Data());
   Printf("fId:        %s", fId.Data());
   Printf("fConfig:    %s", fConfig.Data());
   Printf("fMsd:       %s", fMsd.Data());
   Printf("fPort:      %d", fPort);
   Printf("fPerfIndex: %d\n", fPerfIndex);
}
TProofNodeInfo::ENodeType TProofNodeInfo::GetNodeType(const TString &type)
{
   
   
   ENodeType enType;
   if (type == "M" || type == "master") {
      enType = kMaster;
   }
   else if (type == "S" || type == "submaster") {
      enType = kSubMaster;
   }
   else { 
      enType = kWorker;
   }
   return enType;
}
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.