xrootd
XrdClFSExecutor.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // Copyright (c) 2011-2012 by European Organization for Nuclear Research (CERN)
3 // Author: Lukasz Janyst <ljanyst@cern.ch>
4 //------------------------------------------------------------------------------
5 // XRootD is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // XRootD is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with XRootD. If not, see <http://www.gnu.org/licenses/>.
17 //------------------------------------------------------------------------------
18 
19 #ifndef __XRD_CL_FS_EXECUTOR_HH__
20 #define __XRD_CL_FS_EXECUTOR_HH__
21 
22 #include "XrdCl/XrdClFileSystem.hh"
23 #include "XrdCl/XrdClEnv.hh"
24 #include "XrdCl/XrdClUtils.hh"
25 #include <vector>
26 #include <string>
27 #include <map>
28 
29 namespace XrdCl
30 {
31  //----------------------------------------------------------------------------
33  //----------------------------------------------------------------------------
34  class FSExecutor
35  {
36  public:
37  //------------------------------------------------------------------------
39  //------------------------------------------------------------------------
40  typedef std::vector<std::string> CommandParams;
41 
42  //------------------------------------------------------------------------
44  //------------------------------------------------------------------------
45  typedef XRootDStatus (*Command)( FileSystem *fs,
46  Env *env,
47  const CommandParams &args );
48 
49  //------------------------------------------------------------------------
54  //------------------------------------------------------------------------
55  FSExecutor( const URL &url, Env *env = 0 );
56 
57  //------------------------------------------------------------------------
59  //------------------------------------------------------------------------
61 
62  //------------------------------------------------------------------------
68  //------------------------------------------------------------------------
69  bool AddCommand( const std::string &name, Command command );
70 
71  //------------------------------------------------------------------------
77  //------------------------------------------------------------------------
79 
80  //------------------------------------------------------------------------
82  //------------------------------------------------------------------------
84  {
85  return pEnv;
86  }
87 
88  private:
89 
90  typedef std::map<std::string, Command> CommandMap;
94  };
95 }
96 
97 #endif // __XRD_CL_FS_EXECUTOR_HH__
XrdCl::Env
Definition: XrdClEnv.hh:37
XrdClFileSystem.hh
XrdCl::FSExecutor::pEnv
Env * pEnv
Definition: XrdClFSExecutor.hh:92
XrdCl::FSExecutor::AddCommand
bool AddCommand(const std::string &name, Command command)
XrdCl::FSExecutor::pCommands
CommandMap pCommands
Definition: XrdClFSExecutor.hh:93
XrdCl::FSExecutor::CommandParams
std::vector< std::string > CommandParams
Definition of command argument list.
Definition: XrdClFSExecutor.hh:40
XrdClEnv.hh
XrdCl::FSExecutor::Command
XRootDStatus(* Command)(FileSystem *fs, Env *env, const CommandParams &args)
Definition of a command.
Definition: XrdClFSExecutor.hh:45
XrdCl::XRootDStatus
Request status.
Definition: XrdClXRootDResponses.hh:215
XrdCl::FSExecutor::pFS
FileSystem * pFS
Definition: XrdClFSExecutor.hh:91
XrdCl::FSExecutor::Execute
XRootDStatus Execute(const CommandParams &args)
XrdCl::FileSystem
Send file/filesystem queries to an XRootD cluster.
Definition: XrdClFileSystem.hh:203
XrdCl::FSExecutor::~FSExecutor
~FSExecutor()
Destructor.
XrdCl
Definition: XrdClAnyObject.hh:26
XrdCl::FSExecutor::CommandMap
std::map< std::string, Command > CommandMap
Definition: XrdClFSExecutor.hh:90
XrdClUtils.hh
XrdCl::FSExecutor::FSExecutor
FSExecutor(const URL &url, Env *env=0)
XrdCl::URL
URL representation.
Definition: XrdClURL.hh:31
XrdCl::FSExecutor::GetEnv
Env * GetEnv()
Get the environment.
Definition: XrdClFSExecutor.hh:83
XrdCl::FSExecutor
Execute queries given as a commandline.
Definition: XrdClFSExecutor.hh:35