XRootD
Loading...
Searching...
No Matches
XrdCl::OpenImpl< HasHndl > Class Template Reference

Open operation (. More...

#include <XrdClFileOperations.hh>

+ Inheritance diagram for XrdCl::OpenImpl< HasHndl >:
+ Collaboration diagram for XrdCl::OpenImpl< HasHndl >:

Public Types

enum  {
  UrlArg ,
  FlagsArg ,
  ModeArg
}
 Argument indexes in the args tuple. More...
 

Public Member Functions

 OpenImpl (Ctx< File > f, Arg< std::string > url, Arg< OpenFlags::Flags > flags, Arg< Access::Mode > mode=Access::None)
 Constructor (.
 
template<bool from>
 OpenImpl (OpenImpl< from > &&open)
 
template<typename Hdlr >
OpenImpl< true > operator>> (Hdlr &&hdlr)
 
std::string ToString ()
 
- Public Member Functions inherited from XrdCl::FileOperation< OpenImpl, HasHndl, Resp< void >, Arg< std::string >, Arg< OpenFlags::Flags >, Arg< Access::Mode > >
 FileOperation (Ctx< File > f, Arguments... args)
 
 FileOperation (FileOperation< OpenImpl, from, Resp< void >, Arguments... > &&op)
 
virtual ~FileOperation ()
 Destructor.
 
- Public Member Functions inherited from XrdCl::ConcreteOperation< OpenImpl, HasHndl, Resp< void >, Arguments... >
 ConcreteOperation (Args &&... args)
 
 ConcreteOperation (ConcreteOperation< OpenImpl, from, Resp< void >, Args... > &&op)
 
Operation< HasHndl > * Move ()
 
OpenImpl< true > operator>> (Hdlr &&hdlr)
 
OpenImpl< true > operator| (FinalOperation &&fo)
 Adds a final operation to the pipeline.
 
OpenImpl< true > operator| (Operation< false > &&op)
 
OpenImpl< true > operator| (Operation< false > &op)
 
OpenImpl< true > operator| (Operation< true > &&op)
 
OpenImpl< true > operator| (Operation< true > &op)
 
OpenImpl< HasHndl > Timeout (uint16_t timeout)
 Set operation timeout.
 
Operation< true > * ToHandled ()
 
- Public Member Functions inherited from XrdCl::Operation< HasHndl >
 Operation ()
 Constructor.
 
template<bool from>
 Operation (Operation< from > &&op)
 Move constructor between template instances.
 
virtual ~Operation ()
 Destructor.
 

Protected Member Functions

XRootDStatus RunImpl (PipelineHandler *handler, uint16_t pipelineTimeout)
 
- Protected Member Functions inherited from XrdCl::ConcreteOperation< OpenImpl, HasHndl, Resp< void >, Arguments... >
OpenImpl< true > StreamImpl (ResponseHandler *handler)
 
OpenImpl< toTransform ()
 
- Protected Member Functions inherited from XrdCl::Operation< HasHndl >
void AddOperation (Operation< true > *op)
 
void Run (Timeout timeout, std::promise< XRootDStatus > prms, std::function< void(const XRootDStatus &)> final)
 

Additional Inherited Members

- Static Protected Member Functions inherited from XrdCl::ConcreteOperation< OpenImpl, HasHndl, Resp< void >, Arguments... >
static void AllocHandler (ConcreteOperation< OpenImpl, false, Resp< void >, Args... > &me)
 
static void AllocHandler (ConcreteOperation< OpenImpl, true, Resp< void >, Args... > &me)
 
static OpenImpl< true > PipeImpl (ConcreteOperation< OpenImpl, HasHndl, Resp< void >, Args... > &me, Operation< false > &op)
 
static OpenImpl< true > PipeImpl (ConcreteOperation< OpenImpl, HasHndl, Resp< void >, Args... > &me, Operation< true > &op)
 
- Protected Attributes inherited from XrdCl::FileOperation< OpenImpl, HasHndl, Resp< void >, Arg< std::string >, Arg< OpenFlags::Flags >, Arg< Access::Mode > >
Ctx< Filefile
 The file object itself.
 
- Protected Attributes inherited from XrdCl::ConcreteOperation< OpenImpl, HasHndl, Resp< void >, Arguments... >
std::tuple< Args... > args
 Operation arguments.
 
uint16_t timeout
 Operation timeout.
 
- Protected Attributes inherited from XrdCl::Operation< HasHndl >
std::unique_ptr< PipelineHandlerhandler
 Operation handler.
 
bool valid
 Flag indicating if it is a valid object.
 

Detailed Description

template<bool HasHndl>
class XrdCl::OpenImpl< HasHndl >

Open operation (.

See also
FileOperation)

Definition at line 95 of file XrdClFileOperations.hh.

Member Enumeration Documentation

◆ anonymous enum

template<bool HasHndl>
anonymous enum

Argument indexes in the args tuple.

Enumerator
UrlArg 
FlagsArg 
ModeArg 

Definition at line 170 of file XrdClFileOperations.hh.

Constructor & Destructor Documentation

◆ OpenImpl() [1/2]

template<bool HasHndl>
XrdCl::OpenImpl< HasHndl >::OpenImpl ( Ctx< File > f,
Arg< std::string > url,
Arg< OpenFlags::Flags > flags,
Arg< Access::Mode > mode = Access::None )
inline

Constructor (.

See also
FileOperation)

Definition at line 144 of file XrdClFileOperations.hh.

145 :
146 FileOperation<OpenImpl, HasHndl, Resp<void>, Arg<std::string>, Arg<OpenFlags::Flags>,
147 Arg<Access::Mode>>( std::move( f ), std::move( url ), std::move( flags ),
148 std::move( mode ) )
149 {
150 }

◆ OpenImpl() [2/2]

template<bool HasHndl>
template<bool from>
XrdCl::OpenImpl< HasHndl >::OpenImpl ( OpenImpl< from > && open)
inline

Move constructor from other states

  • from : state from which the object is being converted
Parameters
open: the object that is being converted

Definition at line 160 of file XrdClFileOperations.hh.

160 :
161 FileOperation<OpenImpl, HasHndl, Resp<void>, Arg<std::string>, Arg<OpenFlags::Flags>,
162 Arg<Access::Mode>>( std::move( open ) )
163 {
164 }
#define open
Definition XrdPosix.hh:71

Member Function Documentation

◆ operator>>()

template<bool HasHndl>
template<typename Hdlr >
OpenImpl< true > XrdCl::OpenImpl< HasHndl >::operator>> ( Hdlr && hdlr)
inline

Overload of operator>> defined in ConcreteOperation, we're adding additional capabilities by using ExResp factory (

See also
ExResp).
Parameters
hdlr: function/functor/lambda

Definition at line 179 of file XrdClFileOperations.hh.

180 {
181 ExResp factory( *this->file );
182 return this->StreamImpl( factory.Create( hdlr ) );
183 }

◆ RunImpl()

template<bool HasHndl>
XRootDStatus XrdCl::OpenImpl< HasHndl >::RunImpl ( PipelineHandler * handler,
uint16_t pipelineTimeout )
inlineprotectedvirtual

RunImpl operation (

See also
Operation)
Parameters
pipelineTimeout: pipeline timeout
Returns
: status of the operation

Implements XrdCl::Operation< HasHndl >.

Definition at line 201 of file XrdClFileOperations.hh.

202 {
203 const std::string &url = std::get<UrlArg>( this->args );
204 OpenFlags::Flags flags = std::get<FlagsArg>( this->args );
205 Access::Mode mode = std::get<ModeArg>( this->args );
206 uint16_t timeout = pipelineTimeout < this->timeout ?
207 pipelineTimeout : this->timeout;
208 return this->file->Open( url, flags, mode, handler, timeout );
209 }
std::unique_ptr< PipelineHandler > handler
Operation handler.
Flags
Open flags, may be or'd when appropriate.

◆ ToString()

template<bool HasHndl>
std::string XrdCl::OpenImpl< HasHndl >::ToString ( )
inlinevirtual
Returns
: name of the operation (
See also
Operation)

Implements XrdCl::Operation< HasHndl >.

Definition at line 188 of file XrdClFileOperations.hh.

189 {
190 return "Open";
191 }

The documentation for this class was generated from the following file: