src/MultiSys/ExProcess.cc
/* This will be a parameter such as    Exch(0)  (2) : (0<=>1+2) - Exchange scheme

   The string value defines the components (subsystems) involved in the exchange
   process. The function getExch will just get the process definition, it doesn't
   bother to parse it. The fucntion parseExch will take the string from getExch
   and split it up int left hand side (L.H.S.) and right hand side (R.H.S)
   components. Function getComps just oversees the process of getting the
   components so that it looks like it is done in one step.

   The string value of Exch will be something akin to (0<=>1+2). We need to then
   to parse out the integer values on each side of <=>, but lying between ().
   Also we must keep track of which are on the left and which are on the right
   and how many of these there are (separated by + signs).                      */
This will be a parameter such as    Exch(0)  (2) : (0<=>1+2) - Exchange scheme
The string value defines the components (subsystems) involved in the exchange
process. The function getExch will just get the process definition, it doesn't
bother to parse it. The fucntion parseExch will take the string from getExch
and split it up int left hand side (L.H.S.) and right hand side (R.H.S)
components. Function getComps just oversees the process of getting the
components so that it looks like it is done in one step.

The string value of Exch will be something akin to (0<=>1+2). We need to then
to parse out the integer values on each side of <=>, but lying between ().
Also we must keep track of which are on the left and which are on the right
and how many of these there are (separated by + signs).
This will be a parameter such as Exch ( 0 ) ( 2 ) : ( 0< = > 1 + 2 ) - Exchange scheme The string value defines the components ( subsystems ) involved in the exchange process . The function getExch will just get the process definition it doesn ' t bother to parse it . The fucntion parseExch will take the string from getExch and split it up int left hand side ( L . H . S . ) and right hand side ( R . H . S ) components . Function getComps just oversees the process of getting the components so that it looks like it is done in one step . The string value of Exch will be something akin to ( 0< = > 1 + 2 ) . We need to then to parse out the integer values on each side of < = > but lying between () . Also we must keep track of which are on the left and which are on the right and how many of these there are ( separated by + signs ) .
bool ExchProc::getExch(const ParameterSet& pset, int idx,
                                                     string& exch, bool warn) const
  {
  exch = string("");                            
  ParameterSet::const_iterator item;         
  string Nidx = "";                             
  if(idx >= 0) Nidx                             
    += string("(")+Gdec(idx)+string(")");       
  string pstate, pname = string("Exch") + Nidx;		
  item = pset.seek(pname);			
  if(item != pset.end())			
    {
    (*item).parse(pname,exch,pstate);		
    return true;				
    }
  if(warn)					
    XPerror(20, pname, 1); 			
  return false;
  }
bool ExchProc :: getExch ( const ParameterSet & pset , int idx , string & exch , bool warn ) const { exch = string ( " " ) ; ParameterSet :: const_iterator item ; string Nidx = " " ; if ( idx >= 0 ) Nidx += string ( " " ) + Gdec ( idx ) + string ( " " ) ; string pstate , pname = string ( " " ) + Nidx ; item = pset . seek ( pname ) ; if ( item != pset . end ( ) ) { ( * item ) . parse ( pname , exch , pstate ) ; return true ; } if ( warn ) XPerror ( 20 , pname , 1 ) ; return false ; }
This will be a parameter such as    Exch(0)  (2) : (0<=>1+2) - Exchange scheme
The string value defines the components (subsystems) involved in the exchange
process.
This will be a parameter such as Exch ( 0 ) ( 2 ) : ( 0< = > 1 + 2 ) - Exchange scheme The string value defines the components ( subsystems ) involved in the exchange process .
// We don't know any exchange // A pix into parameter list // Name addition per index // If index exists then set up // the parameter name to append // Parameter name for process // Pix in pset for Exch(i) // Retrieve the process (string) //   Process as a string //   Return we were successful // If we didnt find the exchange // process definition, warn