XRootD
XrdCl::VectorReadAction Struct Reference

VectorRead action. More...

#include <XrdClAction.hh>

+ Inheritance diagram for XrdCl::VectorReadAction:
+ Collaboration diagram for XrdCl::VectorReadAction:

Public Member Functions

 VectorReadAction (void *file, const ChunkList &chunks, uint16_t timeout)
 
std::string ArgStr ()
 Convert operation arguments into a string. More...
 
std::string Name ()
 Action name. More...
 
void Serialize (AnyObject *response)
 Serialize server response. More...
 
- Public Member Functions inherited from XrdCl::Action
 Action (void *file, uint16_t timeout)
 
virtual ~Action ()
 Destructor. More...
 
void RecordResult (XRootDStatus *st, AnyObject *rsp)
 Record the server response / error / timeout. More...
 
std::string ToString ()
 Convert the action / response data into csv row. More...
 

Public Attributes

ChunkList req
 
- Public Attributes inherited from XrdCl::Action
uint64_t id
 
std::string serialrsp
 
std::chrono::system_clock::time_point start
 
XRootDStatus status
 
std::chrono::system_clock::time_point stop
 
uint16_t timeout
 

Additional Inherited Members

- Static Public Member Functions inherited from XrdCl::Action
static double time (std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > tp)
 Convert timpoint to unix timestamp with ns. More...
 
static double timeNow ()
 Get curretn unix time in ns precision as a double. More...
 

Detailed Description

VectorRead action.

Definition at line 353 of file XrdClAction.hh.

Constructor & Destructor Documentation

◆ VectorReadAction()

XrdCl::VectorReadAction::VectorReadAction ( void *  file,
const ChunkList chunks,
uint16_t  timeout 
)
inline

Definition at line 355 of file XrdClAction.hh.

356  : Action(file, timeout)
357  , req(chunks)
358  {
359  }
uint16_t timeout
Definition: XrdClAction.hh:131
Action(void *file, uint16_t timeout)
Definition: XrdClAction.hh:46

Member Function Documentation

◆ ArgStr()

std::string XrdCl::VectorReadAction::ArgStr ( )
inlinevirtual

Convert operation arguments into a string.

Implements XrdCl::Action.

Definition at line 363 of file XrdClAction.hh.

364  {
365  if (req.empty())
366  return {};
367  std::stringstream ss;
368  ss << req[0].offset << ";" << req[0].length;
369  for (size_t i = 1; i < req.size(); ++i)
370  ss << ";" << req[i].offset << ";" << req[i].length;
371  return ss.str();
372  }

References req.

◆ Name()

std::string XrdCl::VectorReadAction::Name ( )
inlinevirtual

Action name.

Implements XrdCl::Action.

Definition at line 361 of file XrdClAction.hh.

361 { return "VectorRead"; }

◆ Serialize()

void XrdCl::VectorReadAction::Serialize ( AnyObject response)
inlinevirtual

Serialize server response.

Reimplemented from XrdCl::Action.

Definition at line 374 of file XrdClAction.hh.

375  {
376  if (!response)
377  return;
378  VectorReadInfo* ptr = nullptr;
379  response->Get(ptr);
380  std::stringstream ss;
381  ss << ptr->GetSize();
382  auto& chunks = ptr->GetChunks();
383  for (auto& ch : chunks)
384  ss << ';' << ch.offset << ';' << ch.length;
385  serialrsp = ss.str();
386  }
std::string serialrsp
Definition: XrdClAction.hh:134

References XrdCl::AnyObject::Get(), XrdCl::VectorReadInfo::GetChunks(), XrdCl::VectorReadInfo::GetSize(), and XrdCl::Action::serialrsp.

+ Here is the call graph for this function:

Member Data Documentation

◆ req

ChunkList XrdCl::VectorReadAction::req

Definition at line 388 of file XrdClAction.hh.

Referenced by ArgStr().


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