const std::string& option_string)
: t_oop_generator(program)
{
+ (void) option_string;
std::map<std::string, std::string>::const_iterator iter;
iter = parsed_options.find("bindable");
*
* @param ttypedef The type definition
*/
-void t_as3_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_as3_generator::generate_typedef(t_typedef* ttypedef) {
+ (void) ttypedef;
+}
/**
* Enums are a class with a set of static constants.
}
string t_as3_generator::render_const_value(ofstream& out, string name, t_type* type, t_const_value* value) {
+ (void) name;
type = get_true_type(type);
std::ostringstream render;
}
void t_as3_generator::generate_reflection_getters(ostringstream& out, t_type* type, string field_name, string cap_name) {
+ (void) type;
+ (void) cap_name;
indent(out) << "case " << upcase_string(field_name) << ":" << endl;
indent_up();
indent(out) << "return this." << field_name << ";" << endl;
}
void t_as3_generator::generate_reflection_setters(ostringstream& out, t_type* type, string field_name, string cap_name) {
+ (void) type;
+ (void) cap_name;
indent(out) << "case " << upcase_string(field_name) << ":" << endl;
indent_up();
indent(out) << "if (value == null) {" << endl;
*/
void t_as3_generator::generate_process_function(t_service* tservice,
t_function* tfunction) {
+ (void) tservice;
// Open class
indent(f_service_) <<
"private function " << tfunction->get_name() << "():Function {" << endl;
void t_as3_generator::generate_serialize_struct(ofstream& out,
t_struct* tstruct,
string prefix) {
+ (void) tstruct;
out <<
indent() << prefix << ".write(oprot);" << endl;
}
* @return As3 type name, i.e. HashMap<Key,Value>
*/
string t_as3_generator::type_name(t_type* ttype, bool in_container, bool in_init) {
+ (void) in_init;
// In As3 typedefs are just resolved to their real type
ttype = get_true_type(ttype);
string prefix;
*/
string t_as3_generator::base_type_name(t_base_type* type,
bool in_container) {
+ (void) in_container;
t_base_type::t_base tbase = type->get_base();
switch (tbase) {
const map<string, string> &parsed_options,
const string &option_string) : t_oop_generator (program)
{
+ (void) parsed_options;
+ (void) option_string;
/* set the output directory */
this->out_dir_base_ = "gen-c_glib";
string
t_c_glib_generator::type_name (t_type* ttype, bool in_typedef, bool is_const)
{
+ (void) in_typedef;
if (ttype->is_base_type ())
{
string bname = base_type_name ((t_base_type *) ttype);
void
t_c_glib_generator::generate_service_server (t_service *tservice)
{
+ (void) tservice;
/* get some C friendly service names */
string service_name_u = initial_caps_to_underscores (service_name_);
string service_name_uc = to_upper_case (service_name_u);
t_c_glib_generator::generate_serialize_struct (ofstream &out, t_struct *tstruct,
string prefix, int error_ret)
{
+ (void) tstruct;
out <<
indent () << "if ((ret = thrift_struct_write (THRIFT_STRUCT (" << prefix << "), protocol, error)) < 0)" << endl <<
indent () << " return " << error_ret << ";" << endl <<
string prefix, string index,
int error_ret)
{
+ (void) index;
string elem = tmp ("_elem");
t_field felem (tlist->get_elem_type (), elem);
const std::string& option_string)
: t_oop_generator(program)
{
+ (void) option_string;
std::map<std::string, std::string>::const_iterator iter;
iter = parsed_options.find("log_unexpected");
void t_cocoa_generator::generate_cocoa_struct_field_accessor_declarations(ofstream &out,
t_struct* tstruct,
bool is_exception) {
+ (void) is_exception;
const vector<t_field*>& members = tstruct->get_members();
vector<t_field*>::const_iterator m_iter;
for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
void t_cocoa_generator::generate_cocoa_struct_field_accessor_implementations(ofstream& out,
t_struct* tstruct,
bool is_exception) {
+ (void) is_exception;
const vector<t_field*>& fields = tstruct->get_members();
vector<t_field*>::const_iterator f_iter;
for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
void t_cocoa_generator::generate_serialize_struct(ofstream& out,
t_struct* tstruct,
string fieldName) {
+ (void) tstruct;
out <<
indent() << "[" << fieldName << " write: outProtocol];" << endl;
}
const std::string& option_string)
: t_oop_generator(program)
{
+ (void) option_string;
std::map<std::string, std::string>::const_iterator iter;
iter = parsed_options.find("pure_enums");
*
*/
string t_cpp_generator::render_const_value(ofstream& out, string name, t_type* type, t_const_value* value) {
+ (void) name;
std::ostringstream render;
if (type->is_base_type()) {
void t_cpp_generator::generate_deserialize_struct(ofstream& out,
t_struct* tstruct,
string prefix) {
+ (void) tstruct;
indent(out) <<
"xfer += " << prefix << ".read(iprot);" << endl;
}
void t_cpp_generator::generate_serialize_struct(ofstream& out,
t_struct* tstruct,
string prefix) {
+ (void) tstruct;
indent(out) <<
"xfer += " << prefix << ".write(oprot);" << endl;
}
const std::string& option_string)
: t_oop_generator(program)
{
+ (void) parsed_options;
+ (void) option_string;
out_dir_base_ = "gen-csharp";
}
void init_generator();
}
void t_csharp_generator::close_generator() { }
-void t_csharp_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_csharp_generator::generate_typedef(t_typedef* ttypedef) {
+ (void) ttypedef;
+}
void t_csharp_generator::generate_enum(t_enum* tenum) {
string f_enum_name = namespace_dir_+"/" + (tenum->get_name())+".cs";
}
std::string t_csharp_generator::render_const_value(ofstream& out, string name, t_type* type, t_const_value* value) {
+ (void) name;
std::ostringstream render;
if (type->is_base_type()) {
}
void t_csharp_generator::generate_process_function(t_service* tservice, t_function* tfunction) {
+ (void) tservice;
indent(f_service_) <<
"public void " << tfunction->get_name() << "_Process(int seqid, TProtocol iprot, TProtocol oprot)" << endl;
scope_up(f_service_);
}
void t_csharp_generator::generate_serialize_struct(ofstream& out, t_struct* tstruct, string prefix) {
+ (void) tstruct;
out <<
indent() << prefix << ".Write(oprot);" << endl;
}
}
string t_csharp_generator::type_name(t_type* ttype, bool in_container, bool in_init) {
+ (void) in_init;
while (ttype->is_typedef()) {
ttype = ((t_typedef*)ttype)->get_type();
}
}
string t_csharp_generator::base_type_name(t_base_type* tbase, bool in_container) {
+ (void) in_container;
switch (tbase->get_base()) {
case t_base_type::TYPE_VOID:
return "void";
const std::string& option_string)
: t_generator(program)
{
+ (void) parsed_options;
+ (void) option_string;
program_name_[0] = tolower(program_name_[0]);
service_name_[0] = tolower(service_name_[0]);
out_dir_base_ = "gen-erl";
}
void t_erl_generator::hrl_footer(ostream& out, string name) {
+ (void) name;
out << "-endif." << endl;
}
* @param ttypedef The type definition
*/
void t_erl_generator::generate_typedef(t_typedef* ttypedef) {
+ (void) ttypedef;
}
/**
bool is_exception,
bool is_result)
{
+ (void) is_result;
const vector<t_field*>& members = tstruct->get_members();
vector<t_field*>::const_iterator m_iter;
* @param tfunction The function
*/
void t_erl_generator::generate_erl_function_helpers(t_function* tfunction) {
+ (void) tfunction;
}
/**
*/
void t_erl_generator::generate_function_info(t_service* tservice,
t_function* tfunction) {
-
+ (void) tservice;
string name_atom = "'" + tfunction->get_name() + "'";
* Will be called with subnamespace, i.e. is_valid_namespace("twisted")
* will be called for the above example.
*/
- static bool is_valid_namespace(const std::string& sub_namespace) { return false; }
+ static bool is_valid_namespace(const std::string& sub_namespace) {
+ (void) sub_namespace;
+ return false;
+ }
/**
* Escape string to use one in generated sources.
virtual void generate_typedef (t_typedef* ttypedef) = 0;
virtual void generate_enum (t_enum* tenum) = 0;
- virtual void generate_const (t_const* tconst) {}
+ virtual void generate_const (t_const* tconst) {
+ (void) tconst;
+ }
virtual void generate_struct (t_struct* tstruct) = 0;
virtual void generate_service (t_service* tservice) = 0;
virtual void generate_xception (t_struct* txception) {
const string& option_string)
: t_oop_generator(program)
{
+ (void) parsed_options;
+ (void) option_string;
out_dir_base_ = "gen-hs";
}
t_struct* tstruct,
bool is_exception,
bool helper) {
+ (void) helper;
string tname = type_name(tstruct);
string name = tstruct->get_name();
*/
void t_hs_generator::generate_process_function(t_service* tservice,
t_function* tfunction) {
+ (void) tservice;
// Open function
string funname = decapitalize(tfunction->get_name());
indent(f_service_) << "process_" << funname << " (seqid, iprot, oprot, handler) = do" << endl;
void t_hs_generator::generate_deserialize_field(ofstream &out,
t_field* tfield,
string prefix) {
+ (void) prefix;
t_type* type = tfield->get_type();
generate_deserialize_type(out,type);
}
const std::string& option_string)
: t_generator(program)
{
+ (void) parsed_options;
+ (void) option_string;
out_dir_base_ = "gen-html";
escape_.clear();
escape_['&'] = "&";
const std::string& option_string)
: t_oop_generator(program)
{
+ (void) option_string;
std::map<std::string, std::string>::const_iterator iter;
iter = parsed_options.find("beans");
*
* @param ttypedef The type definition
*/
-void t_java_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_java_generator::generate_typedef(t_typedef* ttypedef) {
+ (void) ttypedef;
+}
/**
* Enums are a class with a set of static constants.
}
string t_java_generator::render_const_value(ofstream& out, string name, t_type* type, t_const_value* value) {
+ (void) name;
type = get_true_type(type);
std::ostringstream render;
}
void t_java_generator::generate_get_struct_desc(ofstream& out, t_struct* tstruct) {
+ (void) tstruct;
indent(out) << "@Override" << endl;
indent(out) << "protected TStruct getStructDesc() {" << endl;
indent(out) << " return STRUCT_DESC;" << endl;
}
void t_java_generator::generate_union_hashcode(ofstream& out, t_struct* tstruct) {
+ (void) tstruct;
if (gen_hash_code_) {
indent(out) << "@Override" << endl;
indent(out) << "public int hashCode() {" << endl;
}
void t_java_generator::generate_java_struct_field_by_id(ofstream& out, t_struct* tstruct) {
+ (void) tstruct;
indent(out) << "public _Fields fieldForId(int fieldId) {" << endl;
indent(out) << " return _Fields.findByThriftId(fieldId);" << endl;
indent(out) << "}" << endl << endl;
*/
void t_java_generator::generate_process_function(t_service* tservice,
t_function* tfunction) {
+ (void) tservice;
// Open class
indent(f_service_) <<
"private class " << tfunction->get_name() << " implements ProcessFunction {" << endl;
void t_java_generator::generate_serialize_struct(ofstream& out,
t_struct* tstruct,
string prefix) {
+ (void) tstruct;
out <<
indent() << prefix << ".write(oprot);" << endl;
}
t_map* tmap,
string iter,
string map) {
+ (void) map;
t_field kfield(tmap->get_key_type(), iter + ".getKey()");
generate_serialize_field(out, &kfield, "");
t_field vfield(tmap->get_val_type(), iter + ".getValue()");
}
string t_java_generator::async_argument_list(t_function* tfunct, t_struct* tstruct, t_type* ttype, bool include_types) {
+ (void) ttype;
string result = "";
const vector<t_field*>& fields = tstruct->get_members();
vector<t_field*>::const_iterator f_iter;
}
void t_java_generator::generate_deep_copy_non_container(ofstream& out, std::string source_name, std::string dest_name, t_type* type) {
+ (void) dest_name;
if (type->is_base_type() || type->is_enum() || type->is_typedef()) {
if (((t_base_type*)type)->is_binary()) {
out << "TBaseHelper.copyBinary(" << source_name << ");" << endl;
const std::string& option_string)
: t_oop_generator(program)
{
+ (void) parsed_options;
+ (void) option_string;
std::map<std::string, std::string>::const_iterator iter;
out_dir_base_ = "gen-javame";
}
*
* @param ttypedef The type definition
*/
-void t_javame_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_javame_generator::generate_typedef(t_typedef* ttypedef) {
+ (void) ttypedef;
+}
/**
* Enums are a class with a set of static constants.
}
string t_javame_generator::render_const_value(ofstream& out, string name, t_type* type, t_const_value* value) {
+ (void) name;
type = get_true_type(type);
std::ostringstream render;
}
void t_javame_generator::generate_get_struct_desc(ofstream& out, t_struct* tstruct) {
+ (void) tstruct;
indent(out) << "protected TStruct getStructDesc() {" << endl;
indent(out) << " return STRUCT_DESC;" << endl;
indent(out) << "}" << endl;
}
void t_javame_generator::generate_union_hashcode(ofstream& out, t_struct* tstruct) {
+ (void) tstruct;
indent(out) << "/**" << endl;
indent(out) << " * If you'd like this to perform more respectably, use the hashcode generator option." << endl;
indent(out) << " */" << endl;
}
void t_javame_generator::generate_generic_field_getters_setters(std::ofstream& out, t_struct* tstruct) {
-
+ (void) out;
std::ostringstream getter_stream;
std::ostringstream setter_stream;
*/
void t_javame_generator::generate_process_function(t_service* tservice,
t_function* tfunction) {
+ (void) tservice;
// Open class
indent(f_service_) <<
"private class " << tfunction->get_name() << " implements ProcessFunction {" << endl;
void t_javame_generator::generate_serialize_struct(ofstream& out,
t_struct* tstruct,
string prefix) {
+ (void) tstruct;
out <<
indent() << prefix << ".write(oprot);" << endl;
}
* @return Java type name, i.e. Vector
*/
string t_javame_generator::type_name(t_type* ttype, bool in_container, bool in_init, bool skip_generic) {
+ (void) in_init;
+ (void) skip_generic;
// In Java typedefs are just resolved to their real type
ttype = get_true_type(ttype);
string prefix;
const std::map<std::string, std::string>& parsed_options,
const std::string& option_string) :
t_oop_generator(program) {
-
+ (void) parsed_options;
+ (void) option_string;
out_dir_base_ = "gen-js";
}
*
* @param ttypedef The type definition
*/
-void t_js_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_js_generator::generate_typedef(t_typedef* ttypedef) {
+ (void) ttypedef;
+}
/**
* Generates code for an enumerated type. Since define is expensive to lookup
* @param tservice The service to generate a server for.
*/
void t_js_generator::generate_service_processor(t_service* tservice) {
-
+ (void) tservice;
}
/**
*/
void t_js_generator::generate_process_function(t_service* tservice,
t_function* tfunction) {
-
+ (void) tservice;
+ (void) tfunction;
}
/**
* @param tservice The service to generate a header definition for
*/
void t_js_generator::generate_service_interface(t_service* tservice) {
-
+ (void) tservice;
}
/**
* Generates a REST interface
*/
void t_js_generator::generate_service_rest(t_service* tservice) {
-
+ (void) tservice;
}
/**
t_field* tfield,
string prefix,
bool inclass) {
+ (void) inclass;
t_type* type = get_true_type(tfield->get_type());
if (type->is_void()) {
void t_js_generator::generate_serialize_struct(ofstream &out,
t_struct* tstruct,
string prefix) {
- indent(out) << prefix << ".write(output)" << endl;
+ (void) tstruct;
+ indent(out) << prefix << ".write(output)" << endl;
}
/**
const std::string& option_string)
: t_oop_generator(program)
{
+ (void) parsed_options;
+ (void) option_string;
out_dir_base_ = "gen-ocaml";
}
*/
void t_ocaml_generator::generate_process_function(t_service* tservice,
t_function* tfunction) {
+ (void) tservice;
// Open function
indent(f_service_) <<
"method private process_" << tfunction->get_name() <<
void t_ocaml_generator::generate_serialize_struct(ofstream &out,
t_struct* tstruct,
string prefix) {
+ (void) tstruct;
indent(out) << prefix << "#write(oprot)";
}
const std::string& option_string)
: t_oop_generator(program)
{
+ (void) parsed_options;
+ (void) option_string;
out_dir_base_ = "gen-perl";
escape_['$'] = "\\$";
escape_['@'] = "\\@";
*
* @param ttypedef The type definition
*/
-void t_perl_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_perl_generator::generate_typedef(t_typedef* ttypedef) {
+ (void) ttypedef;
+}
/**
* Generates code for an enumerated type. Since define is expensive to lookup
t_field* tfield,
string prefix,
bool inclass) {
+ (void) inclass;
t_type* type = get_true_type(tfield->get_type());
if (type->is_void()) {
void t_perl_generator::generate_serialize_struct(ofstream &out,
t_struct* tstruct,
string prefix) {
- indent(out) <<
+ (void) tstruct;
+ indent(out) <<
"$xfer += $" << prefix << "->write($output);" << endl;
}
const std::string& option_string)
: t_oop_generator(program)
{
+ (void) option_string;
std::map<std::string, std::string>::const_iterator iter;
iter = parsed_options.find("inlined");
*
* @param ttypedef The type definition
*/
-void t_php_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_php_generator::generate_typedef(t_typedef* ttypedef) {
+ (void) ttypedef;
+}
/**
* Generates code for an enumerated type. Since define is expensive to lookup
void t_php_generator::generate_serialize_struct(ofstream &out,
t_struct* tstruct,
string prefix) {
+ (void) tstruct;
indent(out) <<
"$xfer += $" << prefix << "->write($output);" << endl;
}
const std::string& option_string)
: t_generator(program)
{
+ (void) option_string;
std::map<std::string, std::string>::const_iterator iter;
iter = parsed_options.find("new_style");
*
* @param ttypedef The type definition
*/
-void t_py_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_py_generator::generate_typedef(t_typedef* ttypedef) {
+ (void) ttypedef;
+}
/**
* Generates code for an enumerated type. Done using a class to scope
t_struct* tstruct,
bool is_exception,
bool is_result) {
-
+ (void) is_result;
const vector<t_field*>& members = tstruct->get_members();
const vector<t_field*>& sorted_members = tstruct->get_sorted_members();
vector<t_field*>::const_iterator m_iter;
*/
void t_py_generator::generate_process_function(t_service* tservice,
t_function* tfunction) {
+ (void) tservice;
// Open function
indent(f_service_) <<
"def process_" << tfunction->get_name() <<
t_field* tfield,
string prefix,
bool inclass) {
+ (void) inclass;
t_type* type = get_true_type(tfield->get_type());
if (type->is_void()) {
void t_py_generator::generate_serialize_struct(ofstream &out,
t_struct* tstruct,
string prefix) {
+ (void) tstruct;
indent(out) <<
prefix << ".write(oprot)" << endl;
}
const std::string& option_string)
: t_oop_generator(program)
{
+ (void) parsed_options;
+ (void) option_string;
out_dir_base_ = "gen-rb";
}
*
* @param ttypedef The type definition
*/
-void t_rb_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_rb_generator::generate_typedef(t_typedef* ttypedef) {
+ (void) ttypedef;
+}
/**
* Generates code for an enumerated type. Done using a class to scope
* Generates a ruby union
*/
void t_rb_generator::generate_rb_union(std::ofstream& out, t_struct* tstruct, bool is_exception = false) {
+ (void) is_exception;
generate_rdoc(out, tstruct);
indent(out) << "class " << type_name(tstruct) << " < ::Thrift::Union" << endl;
*/
void t_rb_generator::generate_process_function(t_service* tservice,
t_function* tfunction) {
+ (void) tservice;
// Open function
indent(f_service_) <<
"def process_" << tfunction->get_name() <<
const std::string& option_string)
: t_oop_generator(program)
{
+ (void) parsed_options;
+ (void) option_string;
out_dir_base_ = "gen-st";
}
*
* @param ttypedef The type definition
*/
-void t_st_generator::generate_typedef(t_typedef* ttypedef) {}
+void t_st_generator::generate_typedef(t_typedef* ttypedef) {
+ (void) ttypedef;
+}
void t_st_generator::st_class_def(std::ofstream &out, string name) {
out << "Object subclass: #" << prefix(name) << endl;
const std::string& option_string)
: t_generator(program)
{
+ (void) parsed_options;
+ (void) option_string;
out_dir_base_ = "gen-xsd";
}
*/
void generate_typedef(t_typedef* ttypedef);
- void generate_enum(t_enum* tenum) {}
+ void generate_enum(t_enum* tenum) {
+ (void) tenum;
+ }
void generate_service(t_service* tservice);
void generate_struct(t_struct* tstruct);
%{
+#pragma GCC diagnostic ignored "-Wunused-function"
+#pragma GCC diagnostic ignored "-Wunused-label"
+
#include <string>
#include <errno.h>
* The return value is passed to all other callbacks
* for that function invocation.
*/
- virtual void* getContext(const char* fn_name, void* serverContext) { return NULL; }
+ virtual void* getContext(const char* fn_name, void* serverContext) {
+ (void) fn_name;
+ (void) serverContext;
+ return NULL;
+ }
/**
* Expected to free resources associated with a context.
*/
- virtual void freeContext(void* ctx, const char* fn_name) { }
+ virtual void freeContext(void* ctx, const char* fn_name) {
+ (void) ctx;
+ (void) fn_name;
+ }
/**
* Called before reading arguments.
*/
- virtual void preRead(void* ctx, const char* fn_name) {}
+ virtual void preRead(void* ctx, const char* fn_name) {
+ (void) ctx;
+ (void) fn_name;
+ }
/**
* Called between reading arguments and calling the handler.
*/
- virtual void postRead(void* ctx, const char* fn_name, uint32_t bytes) {}
+ virtual void postRead(void* ctx, const char* fn_name, uint32_t bytes) {
+ (void) ctx;
+ (void) fn_name;
+ (void) bytes;
+ }
/**
* Called between calling the handler and writing the response.
*/
- virtual void preWrite(void* ctx, const char* fn_name) {}
+ virtual void preWrite(void* ctx, const char* fn_name) {
+ (void) ctx;
+ (void) fn_name;
+ }
/**
* Called after writing the response.
*/
- virtual void postWrite(void* ctx, const char* fn_name, uint32_t bytes) {}
+ virtual void postWrite(void* ctx, const char* fn_name, uint32_t bytes) {
+ (void) ctx;
+ (void) fn_name;
+ (void) bytes;
+ }
/**
* Called when an async function call completes successfully.
*/
- virtual void asyncComplete(void* ctx, const char* fn_name) {}
+ virtual void asyncComplete(void* ctx, const char* fn_name) {
+ (void) ctx;
+ (void) fn_name;
+ }
/**
* Called if the handler throws an undeclared exception.
*/
- virtual void handlerError(void* ctx, const char* fn_name) {}
+ virtual void handlerError(void* ctx, const char* fn_name) {
+ (void) ctx;
+ (void) fn_name;
+ }
protected:
TProcessorEventHandler() {}
std::tr1::function<void(bool healthy)> _return,
boost::shared_ptr<TProtocol> oprot,
bool healthy) {
+ (void) oprot;
// This is a stub function to hold a reference to oprot.
return _return(healthy);
}
void join() { stopImpl(true); }
- const ThreadManager::STATE state() const {
+ ThreadManager::STATE state() const {
return state_;
}
}
void ThreadManager::Impl::remove(shared_ptr<Runnable> task) {
+ (void) task;
Synchronized s(monitor_);
if (state_ != ThreadManager::STARTED) {
throw IllegalStateException();
STOPPED
};
- virtual const STATE state() const = 0;
+ virtual STATE state() const = 0;
virtual boost::shared_ptr<ThreadFactory> threadFactory() const = 0;
void TimerManager::remove(shared_ptr<Runnable> task) {
+ (void) task;
Synchronized s(monitor_);
if (state_ != TimerManager::STARTED) {
throw IllegalStateException();
}
}
-const TimerManager::STATE TimerManager::state() const { return state_; }
+TimerManager::STATE TimerManager::state() const { return state_; }
}}} // apache::thrift::concurrency
STOPPED
};
- virtual const STATE state() const;
+ virtual STATE state() const;
private:
boost::shared_ptr<const ThreadFactory> threadFactory_;
namespace apache { namespace thrift { namespace concurrency {
-const int64_t Util::currentTimeTicks(int64_t ticksPerSec) {
+int64_t Util::currentTimeTicks(int64_t ticksPerSec) {
int64_t result;
#if defined(HAVE_CLOCK_GETTIME)
result.tv_usec = (value % MS_PER_S) * US_PER_MS; // ms to us
}
- static const void toTicks(int64_t& result, int64_t secs, int64_t oldTicks,
+ static void toTicks(int64_t& result, int64_t secs, int64_t oldTicks,
int64_t oldTicksPerSec, int64_t newTicksPerSec) {
result = secs * newTicksPerSec;
result += oldTicks * newTicksPerSec / oldTicksPerSec;
/**
* Converts struct timespec to arbitrary-sized ticks since epoch
*/
- static const void toTicks(int64_t& result,
+ static void toTicks(int64_t& result,
const struct timespec& value,
int64_t ticksPerSec) {
return toTicks(result, value.tv_sec, value.tv_nsec, NS_PER_S, ticksPerSec);
/**
* Converts struct timeval to arbitrary-sized ticks since epoch
*/
- static const void toTicks(int64_t& result,
+ static void toTicks(int64_t& result,
const struct timeval& value,
int64_t ticksPerSec) {
return toTicks(result, value.tv_sec, value.tv_usec, US_PER_S, ticksPerSec);
/**
* Converts struct timespec to milliseconds
*/
- static const void toMilliseconds(int64_t& result,
+ static void toMilliseconds(int64_t& result,
const struct timespec& value) {
return toTicks(result, value, MS_PER_S);
}
/**
* Converts struct timeval to milliseconds
*/
- static const void toMilliseconds(int64_t& result,
+ static void toMilliseconds(int64_t& result,
const struct timeval& value) {
return toTicks(result, value, MS_PER_S);
}
/**
* Converts struct timespec to microseconds
*/
- static const void toUsec(int64_t& result, const struct timespec& value) {
+ static void toUsec(int64_t& result, const struct timespec& value) {
return toTicks(result, value, US_PER_S);
}
/**
* Converts struct timeval to microseconds
*/
- static const void toUsec(int64_t& result, const struct timeval& value) {
+ static void toUsec(int64_t& result, const struct timeval& value) {
return toTicks(result, value, US_PER_S);
}
/**
* Get current time as a number of arbitrary-size ticks from epoch
*/
- static const int64_t currentTimeTicks(int64_t ticksPerSec);
+ static int64_t currentTimeTicks(int64_t ticksPerSec);
/**
* Get current time as milliseconds from epoch
*/
- static const int64_t currentTime() { return currentTimeTicks(MS_PER_S); }
+ static int64_t currentTime() { return currentTimeTicks(MS_PER_S); }
/**
* Get current time as micros from epoch
*/
- static const int64_t currentTimeUsec() { return currentTimeTicks(US_PER_S); }
+ static int64_t currentTimeUsec() { return currentTimeTicks(US_PER_S); }
};
}}} // apache::thrift::concurrency
};
void foo(PosixThreadFactory *tf) {
+ (void) tf;
}
bool floodNTest(size_t loop=1, size_t count=100000) {
* pendingTaskCountMax + 1th task. Verify that we unblock when a task completes */
bool blockTest(int64_t timeout=100LL, size_t workerCount=2) {
-
+ (void) timeout;
bool success = false;
try {
}
void PeekProcessor::peekName(const std::string& fname) {
+ (void) fname;
}
void PeekProcessor::peekBuffer(uint8_t* buffer, uint32_t size) {
+ (void) buffer;
+ (void) size;
}
void PeekProcessor::peek(boost::shared_ptr<TProtocol> in,
TType ftype,
int16_t fid) {
+ (void) fid;
in->skip(ftype);
}
template <class Transport_>
uint32_t TBinaryProtocolT<Transport_>::writeStructBegin(const char* name) {
+ (void) name;
return 0;
}
uint32_t TBinaryProtocolT<Transport_>::writeFieldBegin(const char* name,
const TType fieldType,
const int16_t fieldId) {
+ (void) name;
uint32_t wsize = 0;
wsize += writeByte((int8_t)fieldType);
wsize += writeI16(fieldId);
uint32_t TBinaryProtocolT<Transport_>::readFieldBegin(std::string& name,
TType& fieldType,
int16_t& fieldId) {
+ (void) name;
uint32_t result = 0;
int8_t type;
result += readByte(type);
*/
template <class Transport_>
uint32_t TCompactProtocolT<Transport_>::writeStructBegin(const char* name) {
+ (void) name;
lastField_.push(lastFieldId_);
lastFieldId_ = 0;
return 0;
const TType fieldType,
const int16_t fieldId,
int8_t typeOverride) {
+ (void) name;
uint32_t wsize = 0;
// if there's a type override, use that.
uint32_t TCompactProtocolT<Transport_>::readFieldBegin(std::string& name,
TType& fieldType,
int16_t& fieldId) {
+ (void) name;
uint32_t rsize = 0;
int8_t byte;
int8_t type;
uint32_t TDebugProtocol::writeMessageBegin(const std::string& name,
const TMessageType messageType,
const int32_t seqid) {
+ (void) seqid;
string mtype;
switch (messageType) {
case T_CALL : mtype = "call" ; break;
}
uint32_t TDenseProtocol::writeStructBegin(const char* name) {
+ (void) name;
uint32_t xfer = 0;
// The TypeSpec stack should be empty if this is the top-level read/write.
uint32_t TDenseProtocol::writeFieldBegin(const char* name,
const TType fieldType,
const int16_t fieldId) {
+ (void) name;
uint32_t xfer = 0;
// Skip over optional fields.
}
uint32_t TDenseProtocol::readStructBegin(string& name) {
+ (void) name;
uint32_t xfer = 0;
if (ts_stack_.empty()) {
uint32_t TDenseProtocol::readFieldBegin(string& name,
TType& fieldType,
int16_t& fieldId) {
+ (void) name;
uint32_t xfer = 0;
// For optional fields, check to see if they are there.
* Write context data to the transport. Default is to do nothing.
*/
virtual uint32_t write(TTransport &trans) {
+ (void) trans;
return 0;
};
* Read context data from the transport. Default is to do nothing.
*/
virtual uint32_t read(TJSONProtocol::LookaheadReader &reader) {
+ (void) reader;
return 0;
};
}
uint32_t TJSONProtocol::writeStructBegin(const char* name) {
+ (void) name;
return writeJSONObjectStart();
}
uint32_t TJSONProtocol::writeFieldBegin(const char* name,
const TType fieldType,
const int16_t fieldId) {
+ (void) name;
uint32_t result = writeJSONInteger(fieldId);
result += writeJSONObjectStart();
result += writeJSONString(getTypeNameForTypeID(fieldType));
}
uint32_t TJSONProtocol::readStructBegin(std::string& name) {
+ (void) name;
return readJSONObjectStart();
}
uint32_t TJSONProtocol::readFieldBegin(std::string& name,
TType& fieldType,
int16_t& fieldId) {
+ (void) name;
uint32_t result = 0;
// Check if we hit the end of the list
uint8_t ch = reader_.peek();
uint32_t readMessageBegin(std::string& name,
TMessageType& messageType,
int32_t& seqid) {
+ (void) name;
+ (void) messageType;
+ (void) seqid;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
}
uint32_t readStructBegin(std::string& name) {
+ (void) name;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t readFieldBegin(std::string& name,
TType& fieldType,
int16_t& fieldId) {
+ (void) name;
+ (void) fieldType;
+ (void) fieldId;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
}
uint32_t readMapBegin(TType& keyType, TType& valType, uint32_t& size) {
+ (void) keyType;
+ (void) valType;
+ (void) size;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
}
uint32_t readListBegin(TType& elemType, uint32_t& size) {
+ (void) elemType;
+ (void) size;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
}
uint32_t readSetBegin(TType& elemType, uint32_t& size) {
+ (void) elemType;
+ (void) size;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
}
uint32_t readBool(bool& value) {
+ (void) value;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t readBool(std::vector<bool>::reference value) {
+ (void) value;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t readByte(int8_t& byte) {
+ (void) byte;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t readI16(int16_t& i16) {
+ (void) i16;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t readI32(int32_t& i32) {
+ (void) i32;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t readI64(int64_t& i64) {
+ (void) i64;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t readDouble(double& dub) {
+ (void) dub;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t readString(std::string& str) {
+ (void) str;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t readBinary(std::string& str) {
+ (void) str;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support reading (yet).");
}
uint32_t writeMessageBegin(const std::string& name,
const TMessageType messageType,
const int32_t seqid) {
+ (void) name;
+ (void) messageType;
+ (void) seqid;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
uint32_t writeStructBegin(const char* name) {
+ (void) name;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
uint32_t writeFieldBegin(const char* name,
const TType fieldType,
const int16_t fieldId) {
+ (void) name;
+ (void) fieldType;
+ (void) fieldId;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
uint32_t writeMapBegin(const TType keyType,
const TType valType,
const uint32_t size) {
+ (void) keyType;
+ (void) valType;
+ (void) size;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
}
uint32_t writeListBegin(const TType elemType, const uint32_t size) {
+ (void) elemType;
+ (void) size;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
}
uint32_t writeSetBegin(const TType elemType, const uint32_t size) {
+ (void) elemType;
+ (void) size;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
}
uint32_t writeBool(const bool value) {
+ (void) value;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
uint32_t writeByte(const int8_t byte) {
+ (void) byte;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
uint32_t writeI16(const int16_t i16) {
+ (void) i16;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
uint32_t writeI32(const int32_t i32) {
+ (void) i32;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
uint32_t writeI64(const int64_t i64) {
+ (void) i64;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
uint32_t writeDouble(const double dub) {
+ (void) dub;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
uint32_t writeString(const std::string& str) {
+ (void) str;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
uint32_t writeBinary(const std::string& str) {
+ (void) str;
throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
"this protocol does not support writing (yet).");
}
* connections on fd and assign TConnection objects to handle those requests.
*/
void TNonblockingServer::handleEvent(int fd, short which) {
+ (void) which;
// Make sure that libevent didn't mess up the socket handles
assert(fd == serverSocket_);
}
const uint8_t* TBufferedTransport::borrowSlow(uint8_t* buf, uint32_t* len) {
+ (void) buf;
+ (void) len;
// Simply return NULL. We don't know if there is actually data available on
// the underlying transport, so calling read() might block.
return NULL;
}
const uint8_t* TFramedTransport::borrowSlow(uint8_t* buf, uint32_t* len) {
+ (void) buf;
+ (void) len;
// Don't try to be clever with shifting buffers.
// If the fast path failed let the protocol use its slow path.
// Besides, who is going to try to borrow across messages?
}
const uint8_t* TMemoryBuffer::borrowSlow(uint8_t* buf, uint32_t* len) {
+ (void) buf;
rBound_ = wBase_;
if (available_read() >= *len) {
*len = available_read();
}
*code = '\0';
- while (*(code++) == ' ');
+ while (*(code++) == ' ') {};
char* msg = strchr(code, ' ');
if (msg == NULL) {
}
*path = '\0';
- while (*(++path) == ' ');
+ while (*(++path) == ' ') {};
char* http = strchr(path, ' ');
if (http == NULL) {
}
const uint8_t* TZlibTransport::borrow(uint8_t* buf, uint32_t* len) {
+ (void) buf;
// Don't try to be clever with shifting buffers.
// If we have enough data, give a pointer to it,
// otherwise let the protcol use its slow path.
char errorMessage[ERR_LEN];
int main(int argc, char** argv) {
+ (void) argc;
+ (void) argv;
try {
testProtocol<TBinaryProtocol>("TBinaryProtocol");
testProtocol<TCompactProtocol>("TCompactProtocol");
namespace thrift { namespace test { namespace debug {
bool Empty::operator<(Empty const& other) const {
+ (void) other;
// It is empty, so all are equal.
return false;
}
FsyncLog() {}
void fsync(int fd) {
+ (void) fd;
FsyncCall call;
gettimeofday(&call.time, NULL);
calls_.push_back(call);
void set_alarm();
void alarm_handler(int signum) {
+ (void) signum;
// The alarm timed out, which almost certainly means we're stuck
// on a transport that is incorrectly blocked.
++numTriggersFired;