xapian-core
1.4.26
|
#include <fdtracker.h>
Public Member Functions | |
FDTracker () | |
~FDTracker () | |
void | init () |
bool | check () |
const std::string & | get_message () const |
FDTracker (const FDTracker &)=delete | |
FDTracker & | operator= (const FDTracker &)=delete |
Private Member Functions | |
void | mark_fd (int fd) |
bool | check_fd (int fd) const |
Private Attributes | |
std::vector< bool > | fds |
Which fds are open. More... | |
void * | dir_void |
The DIR* from opendir("/proc/self/fd") (or equivalent) cast to void*. More... | |
std::string | message |
Definition at line 32 of file fdtracker.h.
|
inline |
Definition at line 56 of file fdtracker.h.
References check(), init(), and ~FDTracker().
Referenced by get_message().
FDTracker::~FDTracker | ( | ) |
|
delete |
bool FDTracker::check | ( | ) |
Definition at line 108 of file fdtracker.cc.
References CONST_STRLEN, dirent::d_name, errno_to_string(), FD_DIRECTORY, name, readdir(), rewinddir(), and Xapian::Internal::str().
Referenced by FDTracker(), get_message(), and test_driver::runtest().
|
private |
Definition at line 63 of file fdtracker.cc.
|
inline |
Definition at line 64 of file fdtracker.h.
References check(), FDTracker(), init(), message, and operator=().
Referenced by test_driver::runtest().
void FDTracker::init | ( | ) |
Definition at line 77 of file fdtracker.cc.
References dirent::d_name, errno_to_string(), FD_DIRECTORY, opendir(), and readdir().
Referenced by FDTracker(), get_message(), and test_driver::runtest().
|
private |
Definition at line 53 of file fdtracker.cc.
Referenced by get_message().
|
private |
The DIR* from opendir("/proc/self/fd") (or equivalent) cast to void*.
We store this cast to void* here to minimise the header we have to include here.
Definition at line 47 of file fdtracker.h.
|
private |
Which fds are open.
The lowest unused fd is used whenever a new fd is needed so we can expect them to form a dense set and vector<bool> should be an efficient representation both in space and time.
Definition at line 40 of file fdtracker.h.
|
private |
Definition at line 49 of file fdtracker.h.
Referenced by get_message().