Go to the documentation of this file. 1 #ifndef _OME_IO_OBJECTS_H
2 #define _OME_IO_OBJECTS_H "$Id: OMEioObjects.h 357 2020-06-18 23:13:25Z geoff $"
56 virtual int readBytes(
unsigned char *bfr,
size_t bytes,
size_t *actualBytes,
59 virtual int writeBytes(
const unsigned char *bfr,
size_t bytes,
size_t *actualBytes,
66 size_t *actualBytes,
int *errRet,
size_t skipBytes = 0);
74 virtual int close(
int mask = 3) = 0;
79 size_t *actualBytes,
OMEstring *fromInfo,
int *errRet);
81 virtual int sendDatagram(
const unsigned char *bfr,
size_t bytes,
82 size_t *actualBytes,
const char *toInfo,
int *errRet);
93 virtual bool isOpen()
const = 0;
bool(* OMEeventCallbackFP)(class OMEevent *, OMEthread *)
Definition: OMEevent.h:16
@ listen
Definition: OMEioObjects.h:28
#define OME_IO_MULTICAST
Definition: OMEmanifests.h:133
#define OME_IO_NONBLOCKING
Definition: OMEmanifests.h:130
#define OME_IO_CREATE
Definition: OMEmanifests.h:126
#define OME_IO_WRITE
Definition: OMEmanifests.h:122
virtual OMEstring * getPeerAddress() const
Definition: OMEioObjects.cpp:96
void OMEstartCriticalSection(eOMEcriticalSectionLabel regionID)
Definition: OMEmutex.cpp:217
unsigned char * data
Definition: OMEioObjects.h:19
@ nonblocking
Definition: OMEioObjects.h:31
@ mustExist
Definition: OMEioObjects.h:30
size_t length
Definition: OMEioObjects.h:20
@ write
Definition: OMEioObjects.h:28
virtual bool isOpen() const =0
@ read
Definition: OMEioObjects.h:28
@ raw
Definition: OMEioObjects.h:32
virtual ~OMEioDescriptor()
Definition: OMEioObjects.cpp:46
@ truncate
Definition: OMEioObjects.h:30
Implements text and binary string storage.
Definition: OMEstring.h:305
@ multicast
Definition: OMEioObjects.h:32
OMEioDescriptor(uint64_t handle, OMEioEvent::OMEfileType type)
Definition: OMEioObjects.cpp:37
#define OME_IO_RAW
Definition: OMEmanifests.h:132
@ datagram
Definition: OMEioObjects.h:32
virtual int sendDatagram(const unsigned char *bfr, size_t bytes, size_t *actualBytes, const char *toInfo, int *errRet)
Definition: OMEioObjects.cpp:72
virtual int seekToOffset(size_t offset)
Definition: OMEioObjects.cpp:85
virtual OMEstring * getLocalAddress() const
Definition: OMEioObjects.cpp:90
OMEioDescriptor * OMEopenURL(const OMEstring &url, int *errCode)
Open an I/O descriptor based on an URL.
Definition: OMEioObjects.cpp:257
const char srcID[]
Definition: catSym.c:17
#define OME_IO_APPEND
Definition: OMEmanifests.h:129
virtual OMEevent * selectForRead(OMEeventCallbackFP func, OMEthread *t=nullptr)=0
virtual int writeBytes(const unsigned char *bfr, size_t bytes, size_t *actualBytes, int *errRet)=0
#define OME_IO_TRUNCATE
Definition: OMEmanifests.h:128
OMEfileType
Definition: OMEioEvents.h:20
uint64_t getSelectHandle() const OME_ALWAYS_INLINE
Definition: OMEioObjects.h:50
virtual int getErrorStatus() const
Definition: OMEioObjects.cpp:111
virtual int close(int mask=3)=0
virtual OMEevent * selectForWrite(OMEeventCallbackFP func, OMEthread *t=nullptr)=0
virtual int receiveDatagram(unsigned char *bfr, size_t bytes, size_t *actualBytes, OMEstring *fromInfo, int *errRet)
Definition: OMEioObjects.cpp:62
@ create
Definition: OMEioObjects.h:29
uint_fast16_t adjustVector(OMEioVector *result, uint_fast16_t count, const OMEioVector *v, size_t skipCount)
Definition: OMEioObjects.cpp:121
Equivalent of iov structure.
Definition: OMEioObjects.h:18
OMEopenMode
Definition: OMEioObjects.h:28
size_t length() const
Definition: OMEstring.h:401
#define MAX_IO_VECTORS
Definition: OMEioObjects.cpp:15
const char srcID[] OME_USED
Definition: tick_time.cpp:24
OMEioEvent::OMEfileType descriptorType
Definition: OMEioObjects.h:37
virtual OMEioDescriptor * acceptConnection(int *errRet)
Definition: OMEioObjects.cpp:53
@ append
Definition: OMEioObjects.h:31
uint64_t ioHandle
Definition: OMEioObjects.h:36
void OMEendCriticalSection(eOMEcriticalSectionLabel regionID)
Definition: OMEmutex.cpp:236
#define OME_ALWAYS_INLINE
Tell the compiler to alway inline a function, regardless of optimization level.
Definition: compiler_hints.h:364
@ connect
Definition: OMEioObjects.h:29
virtual int writeVectorOfBytes(const OMEioVector *v, uint_fast16_t elementCount, size_t *actualBytes, int *errRet, size_t skipBytes=0)
Definition: OMEioObjects.cpp:154
#define OME_IO_MUST_EXIST
Definition: OMEmanifests.h:127
#define OME_IO_READ
Definition: OMEmanifests.h:121
Base class for events within the FARGOS/VISTA Object Management Environment.
Definition: OMEevent.h:22
int elementCount(OMEthread *thread, OMEtype &result, const OMEtype &arg)
Definition: OILtypeFuncs.cpp:168
static OMEioDescriptor * openIOscheme(const char *name, uint32_t openMode)
Definition: OMEioObjects.cpp:102
@ OME_CRITICAL_SECTION_MISCELLANEOUS
Definition: OMEmutex.h:47
OME debug and profiling interfaces.
Public interface to an OME thread.
Definition: OMEthread.h:60
#define OME_IO_DATAGRAM
Definition: OMEmanifests.h:131
#define LOG_ENDLINE
Closing clause for text line output using << operators.
Definition: logging_api.hpp:2956
#define OME_IO_CONNECT
Definition: OMEmanifests.h:125
#define OME_IO_LISTEN
Definition: OMEmanifests.h:124
int OMEregisterIOscheme(const OMEstring &prefix, OMEopenSchemeFP func)
Register support for new I/O transport scheme.
Definition: OMEioObjects.cpp:219
OMEioDescriptor *(* OMEopenSchemeFP)(const OMEstring &url, int *errRet)
Definition: OMEioObjects.h:99
int length(OMEthread *thread, OMEtype &result, const OMEtype &arg)
Definition: OILtypeFuncs.cpp:19
Base class for open files and sockets.
Definition: OMEioObjects.h:26
virtual int readBytes(unsigned char *bfr, size_t bytes, size_t *actualBytes, int *errRet)=0
#define LOG_CERR(lvl)
Convenience macro that uses LOG_INTO() to conditionally log a message to standard error.
Definition: logging_api.hpp:3014