artdaq::SimpleLookupPolicy Class Reference

This class is intended to find files using a set lookup order. More...

#include <artdaq-core/Utilities/SimpleLookupPolicy.hh>

List of all members.

Public Types

enum  ArgType { ENV_VAR = 0, PATH_STRING = 1 }
 

Flag if the constructor argument is a list of paths or the name of an environment variable.

More...

Public Member Functions

 SimpleLookupPolicy (std::string const &paths, ArgType argType=ArgType::ENV_VAR)
 Constructor.
std::string operator() (std::string const &filename) override
 Perform the file lookup.
virtual ~SimpleLookupPolicy () noexcept
 Default destructor.

Detailed Description

This class is intended to find files using a set lookup order.

This class is intended to find files using the following lookup order:

Definition at line 21 of file SimpleLookupPolicy.hh.


Member Enumeration Documentation

Flag if the constructor argument is a list of paths or the name of an environment variable.

Enumerator:
ENV_VAR 

Constructor argument is environment variable name.

PATH_STRING 

Constructor argument is a list of directories.

Definition at line 28 of file SimpleLookupPolicy.hh.


Constructor & Destructor Documentation

artdaq::SimpleLookupPolicy::SimpleLookupPolicy ( std::string const &  paths,
ArgType  argType = ArgType::ENV_VAR 
)

Constructor.

Parameters:
paths Either the name of an environment variable or a list of directories to search
argType Flag to determine if paths argument is an environment variable or a list of directories

The SimpleLookupPolicy Constructor instantiates the cet::search_path objects used for file lookup.

Definition at line 5 of file SimpleLookupPolicy.cc.


Member Function Documentation

std::string artdaq::SimpleLookupPolicy::operator() ( std::string const &  filename  )  [override]

Perform the file lookup.

Parameters:
filename The name of the file to find
Returns:
The location that the file was found in.

The lookup proceeds in the following order:

  • the absolute path, if provided
  • the current directory
  • the specified list of paths

Definition at line 41 of file SimpleLookupPolicy.cc.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator

Generated on 8 Aug 2017 for artdaq_core by  doxygen 1.6.1