oemolthreadbase

See also

The Input and Output Threads section.

Warning

The interface provided here is for advanced users. Most users should be able to accomplish their goals through the high-level OEReadMolecule and OEWriteMolecule functions.

class oemolthreadbase : public oemolstreambase

The following methods are publicly inherited from oemolstreambase:

ClearCSVHeader

GetFlavor

SetFormat

GetBinaryIOHandler

GetFormat

close

GetCSVHeader

Getgz

open

GetFileName

SetFlavor

The following classes derive from this class:

operator bool

operator bool() const

GetMol

const std::string *GetMol()

Retrieve the next molecule in the stream as a std::string blocking if there are no molecules currently available. The method will return a zero-pointer (NULL) if there are no more molecules left to retrieve.

The user is expected to call delete on the std::string pointer returned from this method.

Note

This method was specifically designed to be thread safe so multiple threads can call this method on the same oemolthreadbase object simultaneously.

PeekMol

const std::string *PeekMol()

Return the next molecule std::string pointer that will be returned by oemolthreadbase.GetMol method.

Note

If multiple threads are calling oemolthreadbase.GetMol and oemolthreadbase.PeekMol then it can not be guaranteed that the thread that called oemolthreadbase.PeekMol will get the same pointer when it later calls oemolthreadbase.GetMol.

PutMol

bool PutMol(const std::string *data)

Place a molecule as a std::string into the stream blocking if the in-memory buffer is full.

In the case of the oemolothread object the output thread will call delete on the pointer to free the memory. Passing a zero-pointer (NULL) will instruct the oemolothread output thread to shut down.

Note

This method was specifically designed to be thread safe so multiple threads can call this method on the same oemolthreadbase object simultaneously.