Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Types | Public Member Functions | Private Attributes
Arc::PayloadMemConst Class Reference
Inheritance diagram for Arc::PayloadMemConst:
Inheritance graph
[legend]
Collaboration diagram for Arc::PayloadMemConst:
Collaboration graph
[legend]

List of all members.

Public Types

typedef signed long long int Size_t

Public Member Functions

 PayloadMemConst (void *buffer, uint64_t offset, unsigned int length, uint64_t size=0)
virtual ~PayloadMemConst ()
virtual char operator[] (Size_t pos) const
 Returns content of byte at specified position.
virtual char * Content (Size_t pos=-1)
 Get pointer to buffer content at global position 'pos'.
virtual Size_t Size () const
 Returns logical size of whole structure.
virtual char * Insert (Size_t=0, Size_t=0)
 Create new buffer at global position 'pos' of size 'size'.
virtual char * Insert (const char *, Size_t=0, Size_t=0)
 Create new buffer at global position 'pos' of size 'size'.
virtual char * Buffer (unsigned int num)
 Returns pointer to num'th buffer.
virtual Size_t BufferSize (unsigned int num) const
 Returns length of num'th buffer.
virtual Size_t BufferPos (unsigned int num) const
 Returns position of num'th buffer.
virtual bool Truncate (Size_t)
 Change size of stored information.

Private Attributes

char * buffer_
uint64_t begin_
uint64_t end_
uint64_t size_

Detailed Description

Definition at line 58 of file DataPointHTTP.cpp.


Member Typedef Documentation

typedef signed long long int Arc::PayloadRawInterface::Size_t [inherited]

Definition at line 19 of file PayloadRaw.h.


Constructor & Destructor Documentation

Arc::PayloadMemConst::PayloadMemConst ( void *  buffer,
uint64_t  offset,
unsigned int  length,
uint64_t  size = 0 
) [inline]

Definition at line 66 of file DataPointHTTP.cpp.

      : buffer_((char*)buffer),
        begin_(offset),
        end_(offset + length),
        size_(size) {}
virtual Arc::PayloadMemConst::~PayloadMemConst ( ) [inline, virtual]

Definition at line 74 of file DataPointHTTP.cpp.

{}

Member Function Documentation

virtual char* Arc::PayloadMemConst::Buffer ( unsigned int  num) [inline, virtual]

Returns pointer to num'th buffer.

Implements Arc::PayloadRawInterface.

Definition at line 104 of file DataPointHTTP.cpp.

                                           {
      if (num != 0)
        return NULL;
      return buffer_;
    }
virtual Size_t Arc::PayloadMemConst::BufferPos ( unsigned int  num) const [inline, virtual]

Returns position of num'th buffer.

Implements Arc::PayloadRawInterface.

Definition at line 117 of file DataPointHTTP.cpp.

                                                     {
      if (!buffer_)
        return 0;
      if (num != 0)
        return 0;
      return begin_;
    }
virtual Size_t Arc::PayloadMemConst::BufferSize ( unsigned int  num) const [inline, virtual]

Returns length of num'th buffer.

Implements Arc::PayloadRawInterface.

Definition at line 109 of file DataPointHTTP.cpp.

                                                      {
      if (!buffer_)
        return 0;
      if (num != 0)
        return 0;
      return
        end_ - begin_;
    }
virtual char* Arc::PayloadMemConst::Content ( Size_t  pos = -1) [inline, virtual]

Get pointer to buffer content at global position 'pos'.

By default to beginning of main buffer whatever that means.

Implements Arc::PayloadRawInterface.

Definition at line 84 of file DataPointHTTP.cpp.

                                           {
      if (!buffer_)
        return NULL;
      if (pos < begin_)
        return NULL;
      if (pos >= end_)
        return NULL;
      return
        buffer_ + (pos - begin_);
    }
virtual char* Arc::PayloadMemConst::Insert ( Size_t  pos = 0,
Size_t  size = 0 
) [inline, virtual]

Create new buffer at global position 'pos' of size 'size'.

Implements Arc::PayloadRawInterface.

Definition at line 97 of file DataPointHTTP.cpp.

                                                     {
      return NULL;
    }
virtual char* Arc::PayloadMemConst::Insert ( const char *  s,
Size_t  pos = 0,
Size_t  size = 0 
) [inline, virtual]

Create new buffer at global position 'pos' of size 'size'.

Created buffer is filled with content of memory at 's'. If 'size' is negative content at 's' is expected to be null-terminated.

Implements Arc::PayloadRawInterface.

Definition at line 100 of file DataPointHTTP.cpp.

                                                     {
      return NULL;
    }
virtual char Arc::PayloadMemConst::operator[] ( Size_t  pos) const [inline, virtual]

Returns content of byte at specified position.

Specified position 'pos' is treated as global one and goes through all buffers placed one after another.

Implements Arc::PayloadRawInterface.

Definition at line 75 of file DataPointHTTP.cpp.

                                              {
      if (!buffer_)
        return 0;
      if (pos < begin_)
        return 0;
      if (pos >= end_)
        return 0;
      return buffer_[pos - begin_];
    }
virtual Size_t Arc::PayloadMemConst::Size ( ) const [inline, virtual]

Returns logical size of whole structure.

Implements Arc::PayloadRawInterface.

Definition at line 94 of file DataPointHTTP.cpp.

                                {
      return size_;
    }
virtual bool Arc::PayloadMemConst::Truncate ( Size_t  size) [inline, virtual]

Change size of stored information.

If size exceeds end of allocated buffer, buffers are not re-allocated, only logical size is extended. Buffers with location behind new size are deallocated.

Implements Arc::PayloadRawInterface.

Definition at line 124 of file DataPointHTTP.cpp.

                                    {
      return false;
    }

Member Data Documentation

uint64_t Arc::PayloadMemConst::begin_ [private]

Definition at line 62 of file DataPointHTTP.cpp.

Definition at line 61 of file DataPointHTTP.cpp.

uint64_t Arc::PayloadMemConst::end_ [private]

Definition at line 63 of file DataPointHTTP.cpp.

uint64_t Arc::PayloadMemConst::size_ [private]

Definition at line 64 of file DataPointHTTP.cpp.


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