Repository navigation
xmlrpc_client: thread cvc::app& through rpc/rpc_call API - #26
Merged
Merged
Conversation
Removes the last cvcapp/app::instance() references from xmlrpc_client.cpp. The free functions rpc(), rpc_call() now take 'cvc::app &ctx' as first parameter and forward it to xmlrpc_client_thread, which holds an app* and calls ctx.log()/ctx.data() instead of cvcapp.log/cvcapp.data. Also dropped the unused 'queue_xmlrpc_client_thread' and 'process_xmlrpc_client_threads' classes plus their static initializer. The class comment already noted async calls were broken since 2014, the on_startup() registration was commented-out (// CVC_NAMESPACE::state...), and the static_init had no effect. Updated: - inc/cvc/utility.h: rpc/rpc_call signatures gain leading 'app &ctx'. - src/cvc/libcvc.cpp: client() command passes its ctx through to rpc(). After this change, libcvc.cpp + xmlrpc_client.cpp are free of cvcapp. Remaining sites: app.h/app.cpp singleton mechanics, state.cpp:98-101, state_object.h:218 default ctor, and xmlrpc_server.cpp. Build + ctest -j8 green: 590/590 (one ThreadProgressPersistence flake passed on rerun).
transfix
force-pushed
the
cvc-singleton/xmlrpc-client-ctx
branch
from
May 2, 2026 21:06
379ba68 to
e347782
Compare
transfix
added a commit
that referenced
this pull request
May 3, 2026
Mirrors the #26 xmlrpc_client migration. xmlrpc_server_thread now takes cvc::app& at construction, stores it as a member, and uses state::instance(*_app) and _app->log/sleep/startThread instead of the cvcstate/cvcapp singleton macros. Method classes (cvcstate_*) now also carry an app* and resolve state through the bound context. The static monitor()/init() in the namespace-private bootstrapper takes ctx explicitly (captured once from app::instance() at startup). This also fixes a pre-existing build break under -DCVC_USING_XMLRPC=ON: the 1-arg thread_feedback() default ctor was removed in #25 and xmlrpc_server.cpp was the last unbuilt caller of it. Verified locally with CVC_USING_XMLRPC=ON: 590/590 tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the last
cvcapp/app::instance()references fromsrc/cvc/xmlrpc_client.cpp.The free functions
rpc()andrpc_call()now takecvc::app &ctxas their first parameter and forward it toxmlrpc_client_thread, which now holds anapp *member and callsctx.log()/ctx.data()instead ofcvcapp.log/cvcapp.data.Also drops the unused
queue_xmlrpc_client_threadandprocess_xmlrpc_client_threadsclasses plus their static initializer:on_startup()registration was commented out (// CVC_NAMESPACE::state::on_startup(init);).static_inittherefore had no runtime effect.Updated:
inc/cvc/utility.h:rpc/rpc_callsignatures gain leadingapp &ctx.src/cvc/libcvc.cpp:client()command passes itsctxthrough torpc().After this change,
libcvc.cppandxmlrpc_client.cppare free ofcvcapp. Remaining singleton sites:app.h/app.cppmechanics,state.cpp:98-101,state_object.h:218default ctor, andxmlrpc_server.cpp.Build +
ctest -j8green: 590/590 (one ThreadProgressPersistence flake passed on rerun, unrelated).