CMS 3D CMS Logo

IOChannel.cc
Go to the documentation of this file.
3 #include <algorithm>
4 #include <cassert>
5 
31 
57 
61 IOChannel::IOChannel(IOFD fd /* = EDM_IOFD_INVALID */) : m_fd(fd) {}
62 
64 
68 
69 IOFD IOChannel::fd(void) const { return m_fd; }
70 
74  // FIXME: close old one?
75  // FIXME: reset state?
76  m_fd = value;
77 }
78 
82 
84 void IOChannel::close(void) {
85  if (fd() == EDM_IOFD_INVALID)
86  return;
87 
88  int error = 0;
89  if (!sysclose(fd(), &error))
90  throwStorageError("FileCloseError", "Calling IOChannel::close()", "sysclose()", error);
91 
93 }
IOChannel::close
virtual void close(void)
Definition: IOChannel.cc:84
IOChannel::IOChannel
IOChannel(IOFD fd=-1)
Definition: IOChannel.cc:61
relativeConstraints.error
error
Definition: relativeConstraints.py:53
ztee.fd
fd
Definition: ztee.py:136
value
Definition: value.py:1
throwStorageError
void throwStorageError(const char *category, const char *context, const char *call, int error)
Definition: Throw.cc:6
IOFD
int IOFD
Definition: IOTypes.h:22
IOChannel::~IOChannel
~IOChannel(void) override
Definition: IOChannel.cc:63
IOChannel::sysclose
bool sysclose(IOFD fd, int *error=nullptr)
Definition: UnixIOChannel.cc:127
IOChannel::m_fd
IOFD m_fd
Definition: IOChannel.h:38
EDM_IOFD_INVALID
#define EDM_IOFD_INVALID
Definition: IOTypes.h:8
relativeConstraints.value
value
Definition: relativeConstraints.py:53
IOChannel::fd
virtual IOFD fd(void) const
Definition: IOChannel.cc:69
Throw.h
IOChannel.h