Skip to content

state: drop legacy zero-arg singleton, _instance cache, and cvcstate macro - #36

Merged
transfix merged 1 commit into
masterfrom
cvc-singleton/drop-state-singleton
May 4, 2026
Merged

transfix merged 1 commit into
masterfrom
cvc-singleton/drop-state-singleton

Conversation

@transfix

@transfix transfix commented May 4, 2026

Copy link
Copy Markdown
Owner

Capstone of the per-app state migration (PRs #30-#35). With every production and test caller now routing through cvc::state::instance(cvc::app&), the legacy singleton API surface is unreachable and is removed:

  • cvcstate macro (inc/cvc/state.h)
  • cvc::state::instance() zero-arg overload (declaration + definition)
  • cvc::state::instancePtr() zero-arg shim
  • state::_instance static cache + the &ctx == &app::instance() cache-write block in instancePtr(app&)

State roots are now exclusively per-app, stored on the app's data map under "__state".

Local: 590/590 with -DCVC_USING_XMLRPC=ON and OFF.

…macro

All production and test callers now route through cvc::state::instance(app&)
(see PRs #30-#35). Remove the deprecated singleton API surface:

  - cvcstate macro (inc/cvc/state.h)
  - cvc::state::instance() zero-arg overload (declaration + definition)
  - cvc::state::instancePtr() zero-arg shim
  - state::_instance static cache and the &ctx == &app::instance()
    cache-write block in instancePtr(app&)

State roots are now exclusively per-app, stored on the app's data map
under "__state". 590/590 with CVC_USING_XMLRPC=ON and OFF locally.
@transfix
transfix merged commit 626ee29 into master May 4, 2026
19 checks passed
@transfix
transfix deleted the cvc-singleton/drop-state-singleton branch May 4, 2026 21:07
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.
transfix added a commit that referenced this pull request May 4, 2026
The cvcapp / cvcstate macros and the app::instance() / state::instance()
zero-arg singletons have been removed (PRs #36 and #37). Update the
documentation to match:

- README.md: drop the 'Singleton application object (cvcapp)' bullet;
  describe cvc::app as a per-app context object.
- docs/APP_API.md: remove the 'still present so existing code keeps
  compiling' migration note; remove the 'Deprecated: app::instance()
  / cvcapp' subsection; remove the 'Legacy: routes through
  app::instance()' overload entries from thread_info, thread_feedback,
  and scoped_lock signatures.
- docs/STATE_API.md: add a 'Per-app state roots' overview section
  explaining cvc::state::instance(app); rewrite the Construction and
  Access reference; rewrite all cvcstate(...) examples to
  cvc::state::instance(app)(...).
- docs/TESTING.md: introduce 'cvc::app app;' in the Isolation example;
  rewrite cvcstate(...) examples to cvc::state::instance(app)(...).
- docs/THREAD_POOL.md, docs/THREAD_POOL_API.md: rewrite cvcapp.* uses
  to app.*; thread_feedback in pool example takes app& explicitly.
- docs/IMAGE_PROCESSING_ALGORITHMS.md: cvcapp.threadProgress() ->
  app.threadProgress() in three places.
- docs/GRAPHICS_DATA_DRIVEN_UPDATES.md: cvc::state::instance() ->
  cvc::state::instance(app) in the usage example.
transfix added a commit that referenced this pull request May 5, 2026
3.1.0 is the singleton-less API release:

  - Removed cvcapp / cvcstate macros and the zero-arg
    app::instance() / state::instance() singletons (PRs #36, #37).
  - All callers now reach the application context and state tree
    through an explicit cvc::app& argument.
  - Added cvc::app::root() member shorthand equivalent to
    cvc::state::instance(app) (PR #39).
  - Per-app state caching keyed on the owning cvc::app instance.
  - Documentation refresh across README, APP_API, STATE_API,
    TESTING, THREAD_POOL{,_API}, IMAGE_PROCESSING_ALGORITHMS,
    GRAPHICS_DATA_DRIVEN_UPDATES (PR #38).

CMakeLists.txt project version 3.0.0 -> 3.1.0; README Version
History gains a 3.1.0 entry; USAGE.md tarball/path examples
updated.
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