$(call to_forb_subdir, cdr.h) \
$(call to_forb_subdir, cdr_codec.h) \
$(call to_forb_subdir, executor.h) \
+ $(call to_forb_subdir, exec_req.h) \
$(call to_forb_subdir, forb-internal.h) \
$(call to_forb_subdir, iop.h) \
$(call to_forb_subdir, object.h) \
env.major = FORB_EX_NONE;
- skeletons = exec_req->obj->interface->skeletons;
+ /* Allow the implementation to know about request details
+ * (e.g. source). */
+ exec_req->obj->exec_req = exec_req;
/* Invoke the skeleton */
+ skeletons = exec_req->obj->interface->skeletons;
skeletons[exec_req->method_index](&exec_req->codec,
&reply_codec,
exec_req->obj,
#undef ex
return "Invalid error number";
}
+
+/**
+ * Return server id of the requesting application.
+ *
+ * This function should be only called from within interface
+ * implementation,
+ *
+ * @param[in] obj Object being requested
+ * @param[out] req_source Server ID of the requesting application
+ */
+void
+forb_get_req_source(const forb_object obj, forb_server_id *req_source)
+{
+ if (req_source) {
+ if (obj && obj->exec_req) {
+ *req_source = obj->exec_req->source;
+ } else {
+ memset(req_source, 0, sizeof(*req_source));
+ }
+ }
+}
forb_get_server_id(const forb_object obj, forb_server_id *dest);
void
-forb_get_req_source(struct forb_env *env, forb_server_id *req_source);
+forb_get_req_source(const forb_object obj, forb_server_id *req_source);
const char *
forb_strerror(CORBA_Environment *env);
#include <forb/refcnt.h>
#include <forb/basic_types.h>
#include <forb/executor.h>
+#include <forb/exec_req.h>
/**
* Object reference structure.
* are executed in. */
forb_executor_t *executor;
+ /**
+ * Pointer to the execute request in case of remote
+ * invocation.
+ *
+ * @warning If the object can be called both localy and
+ * remotely this field may contain wrong value as the local
+ * and remote requests can be executed in parallel, in
+ * different threads. This will be fixed after even local
+ * invocations will be executed through executors. */
+ forb_exec_req_t *exec_req;
+
gavl_node_t node; /**< Node for forb->objects tree */
/*@}*/
};
#include <forb/basic_types.h>
#include <stdlib.h>
+#include <forb/types.h>
struct forb_object;