NCBI C++ ToolKit
Public Types | Public Member Functions | Protected Attributes | List of all members
CNetStorageObject Class Reference

Search Toolkit Book for CNetStorageObject

Basic network-based data object I/O. More...

#include <connect/services/netstorage.hpp>

+ Inheritance diagram for CNetStorageObject:
+ Collaboration diagram for CNetStorageObject:

Public Types

typedef SNetStorageObjectImplTInstance
 
typedef list< stringTAttributeList
 Get list of names of all attributes set on this object. More...
 

Public Member Functions

 CNetStorageObject (EVoid)
 
 CNetStorageObject (SNetStorageObjectImpl *impl)
 
CNetStorageObjectoperator= (SNetStorageObjectImpl *impl)
 
 operator SNetStorageObjectImpl * ()
 
 operator const SNetStorageObjectImpl * () const
 
SNetStorageObjectImploperator-- (int)
 
const SNetStorageObjectImploperator-- (int) const
 
SNetStorageObjectImploperator-> ()
 
const SNetStorageObjectImploperator-> () const
 
 CNetStorageObject ()
 
string GetLoc (void) const
 Return object locator. More...
 
size_t Read (void *buffer, size_t buf_size)
 Read no more than 'buf_size' bytes of the object contents (starting at the current position) More...
 
void Read (string *data)
 Read object (starting at the current position) and put the read data into a string. More...
 
IReaderGetReader ()
 Get a reference to the IReader interface for reading the data stream of this object. More...
 
bool Eof (void)
 Check if the last Read() has hit EOF. More...
 
void Write (const void *buffer, size_t buf_size)
 Write data to the object (starting at the current position) More...
 
IEmbeddedStreamWriterGetWriter ()
 Get a reference to the IWriter interface for storing data into this object. More...
 
CNcbiIostreamGetRWStream ()
 Get an iostream instance for reading the data stream of this NetStorage object as well as storing data into this object. More...
 
void Write (const string &data)
 Write string to the object (starting at the current position) More...
 
void Close (void)
 Finalize and close the current object stream. More...
 
Uint8 GetSize (void)
 Return size of the object. More...
 
TAttributeList GetAttributeList () const
 
string GetAttribute (const string &attr_name) const
 Get the current value of the specified attribute. More...
 
void SetAttribute (const string &attr_name, const string &attr_value)
 Set the new value for the specified attribute. More...
 
CNetStorageObjectInfo GetInfo (void)
 Return detailed information about the object. More...
 
void SetExpiration (const CTimeout &ttl)
 Updates expiration on the object. More...
 

Protected Attributes

CNetRef< SNetStorageObjectImplm_Impl
 

Detailed Description

Basic network-based data object I/O.

Sequential I/O only Can switch between reading and writing but only explicitly, using Close()

Warning
Different I/O intefaces cannot be used at the same time. E.g. calls to Write(buf) and Write(string) cannot be mixed. Different IO can be used after calling Close().
Once I/O started non-I/O methods cannot be called until Close() is called. E.g. calls to Write() and GetSize() cannot be mixed.

Definition at line 166 of file netstorage.hpp.


The documentation for this class was generated from the following files:
Modified on Wed Feb 21 09:57:11 2024 by modify_doxy.py rev. 669887