X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Finstance.h;h=dc9e45ede805939f62cac8fbb352259c96e1d1f3;hb=d0bcf33155307f66b7e5a35f7934735f83665945;hp=77388d2c8277594d61c9c08ef5493c4ed89ec813;hpb=999006a8904a0f08293f1df7bda81bff914b091a;p=awesomized%2Flibmemcached diff --git a/libmemcached/instance.h b/libmemcached/instance.h index 77388d2c..dc9e45ed 100644 --- a/libmemcached/instance.h +++ b/libmemcached/instance.h @@ -2,7 +2,7 @@ * * Libmemcached library * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ + * Copyright (C) 2012 Data Differential, http://datadifferential.com/ * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -54,16 +54,50 @@ #define MEMCACHED_NI_MAXSERV 32 #endif -struct memcached_instance_st { +#ifdef __cplusplus + +namespace org { +namespace libmemcached { + +// @todo Complete class transformation +struct Instance { + in_port_t port() const + { + return port_; + } + + void port(in_port_t arg) + { + port_= arg; + } + + void mark_server_as_clean() + { + server_failure_counter= 0; + next_retry= 0; + } + + void disable() + { + } + + void enable() + { + } + + uint32_t response_count() const + { + return cursor_active_; + } + struct { bool is_allocated:1; bool is_initialized:1; bool is_shutting_down:1; bool is_dead:1; } options; - uint32_t number_of_hosts; - uint32_t cursor_active; - in_port_t port; + uint32_t cursor_active_; + in_port_t port_; memcached_socket_t fd; uint32_t io_bytes_sent; /* # bytes sent since last read */ uint32_t request_id; @@ -96,3 +130,8 @@ struct memcached_instance_st { char write_buffer[MEMCACHED_MAX_BUFFER]; char hostname[MEMCACHED_NI_MAXHOST]; }; + +} // namespace libmemcached +} // namespace org + +#endif