The first argument is a synthetic this pointer that we require users to
pass around. Change it to shared_ptr<term> instead to make it accessible
to all callers.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Cassandra uses the DataOutput / DataInput interfaces and related classes
(DataOutputPlus, DataOutputStream, AbstractDataOutput, etc.) to serialize
primitive types - integers of various lengths, strings, etc, as part of
various inter-node messages, and so on.
This patch implements similar primitive type serialization/deserialization
in C++. The interface is quite different, but the functionality is the same
and so is the serialized format. The fact that the format is identical
(I verified this) is important, because we want a C++ node to be able to
communicate with a Java node.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
The current shared_ptr implementation is efficient, but does not support
polymorphic types.
Rename it in order to make room for a polymorphic shared_ptr.
Terminate a running memcached instance with a SIGTERM instead of a
SIGKILL to allow the process to close in a cleaner manner
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
A user may be waiting for data, but we never we never notify them if we
receive an RST. As a result the tcb, connection, and any user data structures
will hang around in memory.
Fix by notifying the user if they are waiting, and marking the connection as
nuked so they don't try to read again.
Reviewed-by: Asias He <asias@cloudius-systems.com>
This is not 1:1 conversion because some Term inner classes derive from
Term itself which is not allowed in C++. I therefore moved some of the
inner class definitions outside of Term.
Another painpoint is Terminal.bind() method which returns 'this'. I
changed the API to require callers to pass shared_ptr<terminal> which is
returned in place of 'this'. I went for shared_ptr because I wasn't able
to convince myself that the lifetime rules allow unique_ptr...
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
There are cf_statement derived classes that pass 'null' as 'cf_name'.
Switch to unique_ptr to allow that.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
The conversion is not 1:1 because 'enum class' in C++ does not support
methods. As the methods are rather simple, I moved them out of the class
as standalone functions.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>