2#ifndef CLICK_HANDLERCALL_HH
3#define CLICK_HANDLERCALL_HH
168 : _e(0), _h(
Handler::blank_handler()) {
179 : _e(reinterpret_cast<
Element *>(4)), _h(
Handler::blank_handler()),
246 typedef bool (
HandlerCall::*unspecified_bool_type)() const;
252 operator unspecified_bool_type()
const {
454 CHECK_READ = f_read, OP_READ = f_read, h_read = f_read,
455 CHECK_WRITE = f_write, OP_WRITE = f_write, h_write = f_write,
456 PREINITIALIZE = f_preinitialize, h_preinitialize = f_preinitialize,
457 UNQUOTE_PARAM = f_unquote_param, h_unquote_param = f_unquote_param
475 return reset(hcall, hdesc, f_read, context, errh);
481 return reset(hcall, hdesc, f_write, context, errh);
487 return reset(hcall, e, hname,
String(), f_read, errh);
493 return reset(hcall, e, hname,
value, f_write, errh);
520String cp_expand(
const String &str,
const VariableExpander &env,
bool expand_quote,
int depth);
525 return _h->
call_write(cp_expand(_value, scope,
false, 0), _e, errh);
531 if (_value && value_ext)
532 return _h->
call_write(_value +
" " + value_ext, _e, errh);
534 return _h->
call_write(_value ? _value : value_ext, _e, errh);
Argument context class.
Definition args.hh:31
Base class for Click elements.
Definition element.hh:42
Error reporting class.
Definition error.hh:90
Convenience class for calling handlers.
Definition handlercall.hh:143
HandlerCall()
Construct an empty HandlerCall.
Definition handlercall.hh:167
bool empty() const
Test if HandlerCall is empty.
Definition handlercall.hh:258
static int reset_read(HandlerCall *&hcall, const String &hdesc, const Element *context, ErrorHandler *errh=0)
Create and initialize a read HandlerCall from hdesc.
Definition handlercall.hh:473
int initialize_read(const Element *context, ErrorHandler *errh=0)
Initialize the HandlerCall for reading.
Definition handlercall.hh:497
static int reset_write(HandlerCall *&hcall, const String &hdesc, const Element *context, ErrorHandler *errh=0)
Create and initialize a write HandlerCall from hdesc.
Definition handlercall.hh:479
Element * element() const
Return the Element corresponding to this HandlerCall.
Definition handlercall.hh:409
int initialize(int flags, const Element *context, ErrorHandler *errh=0)
Initialize the HandlerCall.
Definition handlercall.cc:32
static int call_write(Element *e, const String &hname, ErrorHandler *errh=0)
Call a write handler specified by element and handler name.
Definition handlercall.hh:550
void clear()
Make this HandlerCall empty.
Definition handlercall.hh:445
String unparse() const
Return a String that will parse into an equivalent HandlerCall.
Definition handlercall.cc:242
bool initialized() const
Test if HandlerCall is initialized.
Definition handlercall.hh:264
static String call_read(Element *e, const String &hname, ErrorHandler *errh=0)
Call a read handler specified by element and handler name.
Definition handlercall.cc:134
int initialize_write(const Element *context, ErrorHandler *errh=0)
Initialize the HandlerCall for writing.
Definition handlercall.hh:503
HandlerCall(const String &hdesc)
Construct a HandlerCall described by hdesc.
Definition handlercall.hh:178
const String & value() const
Return the write handler value and/or read handler parameters.
Definition handlercall.hh:423
const Handler * handler() const
Return the Handler corresponding to this HandlerCall.
Definition handlercall.hh:416
void set_value(const String &value)
Sets the write handler value and/or read handler parameters.
Definition handlercall.hh:431
static int reset(HandlerCall *&hcall, const String &hdesc, int flags, const Element *context, ErrorHandler *errh=0)
Create and initialize a HandlerCall from hdesc.
Definition handlercall.cc:96
Represents a router's handlers.
Definition handler.hh:19
static const Handler * blank_handler()
Returns a handler incapable of doing anything.
Definition handler.hh:223
int call_write(const String &value, Element *e, ErrorHandler *errh) const
Call a write handler.
Definition router.cc:1709
@ f_read
Handler supports read operations.
Definition handler.hh:22
@ f_write
Handler supports write operations.
Definition handler.hh:23
String call_read(Element *e, const String ¶m, ErrorHandler *errh) const
Call a read handler, possibly with parameters.
Definition router.cc:1691
A string of characters.
Definition string.hh:22
static const String & make_empty()
Return a const reference to an empty String.
Definition string.hh:439
The Router class implementing a router configuration.
Parser class for handler call specifications.
Definition handlercall.hh:568