Loading...
Searching...
No Matches
XrdClFSExecutor.hh
Go to the documentation of this file.
//------------------------------------------------------------------------------
// Copyright (c) 2011-2012 by European Organization for Nuclear Research (CERN)
// Author: Lukasz Janyst <ljanyst@cern.ch>
//------------------------------------------------------------------------------
// XRootD is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// XRootD is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with XRootD. If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------
#ifndef __XRD_CL_FS_EXECUTOR_HH__
#define __XRD_CL_FS_EXECUTOR_HH__
#include "XrdCl/XrdClFileSystem.hh"
#include "XrdCl/XrdClEnv.hh"
#include "XrdCl/XrdClUtils.hh"
#include <vector>
#include <string>
#include <map>
namespace XrdCl
{
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
class FSExecutor
{
public:
//------------------------------------------------------------------------
//------------------------------------------------------------------------
typedef std::vector<std::string> CommandParams;
//------------------------------------------------------------------------
//------------------------------------------------------------------------
typedef XRootDStatus (*Command)( FileSystem *fs,
Env *env,
const CommandParams &args );
//------------------------------------------------------------------------
//------------------------------------------------------------------------
FSExecutor( const URL &url, Env *env = 0 );
//------------------------------------------------------------------------
//------------------------------------------------------------------------
~FSExecutor();
//------------------------------------------------------------------------
//------------------------------------------------------------------------
bool AddCommand( const std::string &name, Command command );
//------------------------------------------------------------------------
//------------------------------------------------------------------------
XRootDStatus Execute( const CommandParams & args);
//------------------------------------------------------------------------
//------------------------------------------------------------------------
Env *GetEnv()
{
return pEnv;
}
private:
typedef std::map<std::string, Command> CommandMap;
FileSystem *pFS;
Env *pEnv;
CommandMap pCommands;
};
}
#endif // __XRD_CL_FS_EXECUTOR_HH__
XrdClEnv.hh
XrdClFileSystem.hh
XrdClUtils.hh
XrdCl::Env
Definition XrdClEnv.hh:38
XrdCl::FSExecutor::CommandParams
std::vector< std::string > CommandParams
Definition of command argument list.
Definition XrdClFSExecutor.hh:40
XrdCl::FSExecutor::~FSExecutor
~FSExecutor()
Destructor.
Definition XrdClFSExecutor.cc:46
XrdCl::FSExecutor::FSExecutor
FSExecutor(const URL &url, Env *env=0)
Definition XrdClFSExecutor.cc:31
XrdCl::FSExecutor::Execute
XRootDStatus Execute(const CommandParams &args)
Definition XrdClFSExecutor.cc:69
XrdCl::FSExecutor::Command
XRootDStatus(* Command)(FileSystem *fs, Env *env, const CommandParams &args)
Definition of a command.
Definition XrdClFSExecutor.hh:45
XrdCl::FSExecutor::AddCommand
bool AddCommand(const std::string &name, Command command)
Definition XrdClFSExecutor.cc:55
XrdCl::FSExecutor::GetEnv
Env * GetEnv()
Get the environment.
Definition XrdClFSExecutor.hh:83
XrdCl::FileSystem
Send file/filesystem queries to an XRootD cluster.
Definition XrdClFileSystem.hh:203
XrdCl::URL
URL representation.
Definition XrdClURL.hh:31
XrdCl::XRootDStatus
Request status.
Definition XrdClXRootDResponses.hh:219
XrdCl
Definition XrdClAction.hh:34