Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:23:58

0001 // -*- C++ -*-
0002 //
0003 // RunDirectories.h is a part of Herwig - A multi-purpose Monte Carlo event generator
0004 // Copyright (C) 2002-2019 The Herwig Collaboration
0005 //
0006 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 #ifndef HERWIG_RunDirectories_H
0010 #define HERWIG_RunDirectories_H
0011 //
0012 // This is the declaration of the RunDirectories class.
0013 //
0014 
0015 #include <string>
0016 #include <list>
0017 
0018 namespace Herwig {
0019 
0020 /**
0021  * \author Simon Platzer
0022  *
0023  * \brief Handle directories for external library and grid storage.
0024  *
0025  */
0026 class RunDirectories {
0027 
0028 public:
0029 
0030   /**
0031    * Set a prefix for storing details of this run.
0032    */
0033   static void prefix(std::string p);
0034 
0035   /**
0036    * Return the prefix for storing details of this run.
0037    */
0038   static const std::string& prefix();
0039 
0040   /**
0041    * Return the name (and possibly create) a storage for build data
0042    */
0043   static const std::string& buildStorage();
0044 
0045   /**
0046    * Return true, if no run directories have been pushed yet
0047    */
0048   static bool empty();
0049 
0050   /**
0051    * Push a run identifier onto the run directories stack.
0052    */
0053   static void pushRunId(std::string);
0054 
0055   /**
0056    * Return (and possibly create) the top of the run directory stack
0057    * to be used for storage.
0058    */
0059   static const std::string& runStorage();
0060 
0061   /**
0062    * Return the storage to be used for interface order/contract files.
0063    */
0064   static const std::string& interfaceStorage();
0065 
0066 public:
0067 
0068   /**
0069    * Default constructor fills the directory list to test.
0070    */
0071   RunDirectories();
0072 
0073   /**
0074    * Return true, if there are run directories still to be considered.
0075    */
0076   operator bool() const { return !directoriesLeft.empty(); }
0077 
0078   /**
0079    * Return true, if there are no run directories still to be considered.
0080    */
0081   bool operator!() const { return directoriesLeft.empty(); }
0082 
0083   /**
0084    * Return the next run directory to be considered and pop it from
0085    * the stack.
0086    */
0087   std::string nextRunStorage();
0088 
0089 private:
0090 
0091   /**
0092    * The prefix for storing details of this run.
0093    */
0094   static std::string& thePrefix();
0095 
0096   /**
0097    * The build storage.
0098    */
0099   static std::string& theBuildStorage();
0100 
0101   /**
0102    * The list of run storage directories to be considered.
0103    */
0104   static std::list<std::string>& theRunDirectories();
0105 
0106   /**
0107    * The current run directory stack under consideration
0108    */
0109   std::list<std::string> directoriesLeft;
0110 
0111 };
0112 
0113 }
0114 
0115 #endif /* HERWIG_RunDirectories_H */