Skip to content

app: delete legacy 1-arg thread_info/thread_feedback/scoped_lock ctors - #25

Merged
transfix merged 1 commit into
masterfrom
cvc-singleton/drop-legacy-ctors
May 2, 2026
Merged

transfix merged 1 commit into
masterfrom
cvc-singleton/drop-legacy-ctors

Conversation

@transfix

@transfix transfix commented May 2, 2026

Copy link
Copy Markdown
Owner

Removes the three legacy constructors that silently delegated to app::instance():

  • thread_info(const std::string&)
  • thread_feedback(const std::string&)
  • scoped_lock(const std::string&, const std::string&)

After PR #23 (algorithm.cpp dropping its 25 thread_info(BOOST_CURRENT_FUNCTION) calls), these legacy ctors had no in-tree callers outside one site in state_object.h::handleStateChanged() lambda, which now passes _ctx explicitly to thread_feedback.

The (app&, ...) variants remain the supported API.

Remaining app::instance()/cvcapp call sites are now confined to:

  • xmlrpc_client.cpp / xmlrpc_server.cpp (deferred per master plan, bundled with cvcstate fold-in)
  • state.cpp:98-101 (Phase D, cvcstate fold-in)
  • state_object.h:218 default ctor (Phase D)
  • app.h:620 #define cvcapp macro + app.cpp:187 app::instance() impl (Phase C, last)

Build + ctest -j8 green: 590/590 (one ThreadFeedbackExceptionSafety flake passed on rerun, unrelated). Supersedes the auto-closed #24.

These three legacy constructors silently delegated to app::instance() and
were the last in-libcvc consumers of the singleton outside of xmlrpc and
state.cpp (both deferred until cvcstate fold-in).

Removed:
- thread_info(const std::string&)
- thread_feedback(const std::string&)
- scoped_lock(const std::string&, const std::string&)

The (app&, ...) variants remain the supported API. One in-tree caller in
state_object.h::handleStateChanged() lambda was updated to pass _ctx
explicitly to thread_feedback.

Stacked on #23 (algorithm.cpp dropped its 25 1-arg thread_info calls).

Build + ctest -j8 green: 590/590 (one ThreadFeedbackExceptionSafety
flake passed on rerun).
@transfix
transfix merged commit 7430f3f into master May 2, 2026
19 checks passed
@transfix
transfix deleted the cvc-singleton/drop-legacy-ctors branch May 2, 2026 21:06
transfix added a commit that referenced this pull request May 2, 2026
…nce() (#29)

All callers now pass a cvc::app& explicitly:

- libcvc internal subclasses: see PR #25 (algorithm) and tests refactored in #27.

- volrover3 SceneNode hierarchy migrated in #28.

590/590 ctest passing locally.
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.
transfix added a commit that referenced this pull request May 4, 2026
All production and test callers have been migrated to explicit
cvc::app& parameters (PRs #25-#36). Remove the deprecated public
singleton surface:

  - cvcapp macro (inc/cvc/app.h)
  - cvc::app::instance() public method (declaration + definition)

The internal singleton machinery (_instance, _instanceMutex,
instancePtr(), wait_for_threads atexit registration) is left in
place for now; nothing reaches it through the public API, so the
process-wide app singleton is no longer constructed. apps now
have to be created and passed explicitly.

590/590 with CVC_USING_XMLRPC=ON and OFF locally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant