37 #ifndef H_OGF_GOM_TYPES_CONNECTION_H
38 #define H_OGF_GOM_TYPES_CONNECTION_H
41 #include <OGF/gom/types/callable.h>
65 gom_attribute(
abstract,
"true")
75 Object* source,
const std::string& sig_name
133 const std::string& name,
const std::string& value
135 if(conditions_.has_arg(name)) {
137 <<
"if_arg(): duplicate condition for " << name
141 conditions_.create_arg(name, value);
155 if(args_.has_arg(name)) {
157 <<
"add_arg(): argument " << name
162 args_.create_arg(name, value);
176 if(rename_args_.has_arg(name)) {
178 <<
"rename_arg(): duplicate rename for " << name
182 rename_args_.create_arg(name, new_name);
195 discard_args_.insert(name);
226 const std::string& value,
const std::string& condition
239 std::string signal_name_;
243 std::set<std::string> discard_args_;
267 Object* source,
const std::string& sig_name,
268 Object* target,
const std::string& slot_name
280 std::string slot_name_;
331 for(
unsigned int i=0; i<size(); i++) {
332 (*this)[i]->invoke(args, ret_val);
342 std::vector<Connection_var>::iterator it = this->begin();
343 while(it != this->end()) {
344 if(it->get() == conn) {
#define geo_assert_not_reached
Sets a non reachable point in the program.
A smart pointer with reference-counted copy semantics.
A class that stores a variable of arbitrary type.
Represents a list of name-value pairs.
A Connection between a signal and an abstract Callable object.
bool invoke_target(const ArgList &args, Any &ret_val) override
Directly invokes the target with an arguments list, without any argument translation.
CallableConnection(Object *source, const std::string &sig_name, Callable *target)
CallableConnection constructor.
void remove(Connection *conn)
Removes a connection from a ConnectionList.
void invoke(const ArgList &args)
Invokes all the connected slots.
virtual bool invoke(const ArgList &args, Any &ret_val)
Invokes the target with an arguments list.
virtual bool invoke_target(const ArgList &args, Any &ret_val)=0
Directly invokes the target with an arguments list, without any argument translation.
Connection * rename_arg(const std::string &name, const std::string &new_name)
Renames an argument.
void remove()
Removes this connection from the slot it is connected to.
Connection * discard_arg(const std::string &name)
Discards an argument.
bool test_arg_conditions(const ArgList &args) const
Tests whether an argument list satisfies the argument conditions.
void translate_args(const ArgList &args_in, ArgList &args_out)
Applies all the argument list transformations.
virtual ~Connection()
Connection destructor.
const std::string & signal_name() const
Gets the signal name.
Object * source() const
Gets the source.
bool test_arg_condition(const std::string &value, const std::string &condition) const
Tests whether an argument satisfies a condition.
Connection * add_arg(const std::string &name, const std::string &value)
Adds an argument.
Connection(Object *source, const std::string &sig_name)
Connection constructor.
Base class for all objects in the GOM system.
A Connection between a signal and a slot.
SlotConnection(Object *source, const std::string &sig_name, Object *target, const std::string &slot_name)
SlotConnection constructor.
bool invoke_target(const ArgList &args, Any &ret_val) override
Directly invokes the target with an arguments list, without any argument translation.
Global Graphite namespace.
SmartPointer< Connection > Connection_var
An automatic reference-counted pointer to a Connection.
Definitions common to all include files in the gom library.