.. index:: pair: namespace; rgpot::ipi::detail .. _doxid-namespacergpot_1_1ipi_1_1detail: namespace rgpot::ipi::detail ============================ .. toctree:: :hidden: struct_rgpot_ipi_detail_Address.rst struct_rgpot_ipi_detail_Deadline.rst struct_rgpot_ipi_detail_Link.rst Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block namespace detail { // typedefs typedef std::array :target:`Header`; typedef std::chrono::steady_clock :target:`Clock`; // structs struct :ref:`Address`; struct :ref:`Deadline`; struct :ref:`Link`; // global variables int :target:`kHeaderLen` = 12; int32_t :target:`kMaxAtoms` = 10'000'000; int32_t :target:`kMaxString` = 1<<20; const char* :target:`kUnixPrefix` = "/tmp/ipi_"; // global functions Header :ref:`header`(std::string_view text); bool :target:`sameHeader`(const char* got, const Header& want); std::string :ref:`headerText`(const char* got); double :ref:`cellVolume`(const double* box); void :target:`fail`(const char* who, const std::string& message); void :target:`failErrno`(const char* who, const std::string& what); void :ref:`waitFd`(const :ref:`Link`& link, short event, const :ref:`Deadline`& deadline, const char* what); void :target:`writeFull`(const :ref:`Link`& link, const void* data, size_t n, const :ref:`Deadline`& deadline); void :target:`readFull`(const :ref:`Link`& link, void* data, size_t n, const :ref:`Deadline`& deadline); bool :ref:`readFullOrEof`(const :ref:`Link`& link, void* data, size_t n, const :ref:`Deadline`& deadline); void :target:`setCloexec`(int fd); void :target:`setNonblock`(int fd); void :target:`disableSigpipe`(int fd); void :target:`setNodelay`(int fd); :ref:`Address` :ref:`parseAddress`(const std::string& address, const char* who, const std::string& unix_prefix); void :ref:`rowsToIpiCell`(const double* box_angstrom, double h[9], double ih[9], const char* who); void :ref:`ipiCellToRows`(const double h[9], double box_angstrom[9]); } // namespace detail .. _details-namespacergpot_1_1ipi_1_1detail: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Global Functions ---------------- .. index:: pair: function; header .. _doxid-_i_p_i_wire_8cc_1a9bd48d938249cb7d59ced3a0fb825630: .. ref-code-block:: cpp :class: doxyrest-title-code-block Header header(std::string_view text) Space-padded header; text longer than 12 bytes is cut. .. index:: pair: function; headerText .. _doxid-_i_p_i_wire_8cc_1a82d40c2bfc5e70d38875cb890c6b3326: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::string headerText(const char* got) Printable form of a received header, trailing spaces removed. .. index:: pair: function; cellVolume .. _doxid-_i_p_i_wire_8cc_1a5da0732721f5baa93b08ef409beed253: .. ref-code-block:: cpp :class: doxyrest-title-code-block double cellVolume(const double* box) Absolute volume of a row-major 3x3 cell. A null or singular cell is 0. .. index:: pair: function; waitFd .. _doxid-_i_p_i_wire_8cc_1add14ee63193bb86fd6cd5b100b418282: .. ref-code-block:: cpp :class: doxyrest-title-code-block void waitFd(const :ref:`Link`& link, short event, const :ref:`Deadline`& deadline, const char* what) Waits for ``event`` (POLLIN or POLLOUT). Throws "timed out " or " disconnected". .. index:: pair: function; readFullOrEof .. _doxid-_i_p_i_wire_8cc_1ad257b8dd03d4e5c68f961b8f49919412: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool readFullOrEof(const :ref:`Link`& link, void* data, size_t n, const :ref:`Deadline`& deadline) readFull, except that a peer that closes before the first byte returns false instead of throwing. .. index:: pair: function; parseAddress .. _doxid-_i_p_i_wire_8cc_1a898e3e46454c0b0fe6295282becb88fe: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Address` parseAddress(const std::string& address, const char* who, const std::string& unix_prefix) Throws std::invalid_argument, prefixed with ``who``. .. index:: pair: function; rowsToIpiCell .. _doxid-_i_p_i_wire_8cc_1adf9be297ea1a2cef820dd8d087991acd: .. ref-code-block:: cpp :class: doxyrest-title-code-block void rowsToIpiCell(const double* box_angstrom, double h[9], double ih[9], const char* who) rgpot cell (lattice vectors in rows, Angstrom) to the i-PI cell (vectors in columns, bohr) and its inverse. Throws std::invalid_argument for a singular cell. .. index:: pair: function; ipiCellToRows .. _doxid-_i_p_i_wire_8cc_1a8ab67ed4fd740fc0c06fcd58c7ad90ce: .. ref-code-block:: cpp :class: doxyrest-title-code-block void ipiCellToRows(const double h[9], double box_angstrom[9]) i-PI cell (vectors in columns, bohr) to rgpot rows in Angstrom.