Skip to content

Delete unused refcount / Resource scaffolding in src/Methcla/Audio/Resource.hpp #148

@kaoskorobase

Description

@kaoskorobase

Motivation

src/Methcla/Audio/Resource.hpp declares a family of refcount + resource-map helpers that are not used anywhere in the codebase. They predate the current implementation; the engine grew past them without anything referencing them, and the file is now load-bearing only as a place that compiles.

Independent of any larger design work — the dead code can be removed on its own.

Dead declarations to remove

All within src/Methcla/Audio/Resource.hpp:

  • Reference (refcounted base class). Not inherited by Node, Synth, Group, AudioBus, or anything else.
  • Resource<Id> template (refcount + env + id). Zero call sites outside the header.
  • ResourceMap<Id, T> (pointer map). Zero call sites — the engine uses plain std::vector<Node*> / std::vector<std::shared_ptr<AudioBus>> instead.
  • ResourceRef<T> (alias for methcla_boost::intrusive_ptr<T>). Zero call sites.
  • intrusive_ptr_add_ref / intrusive_ptr_release template helpers. Only meaningful with the deleted types.

Verified via:

grep -rn "class Resource<\|: Reference\b\|: Resource<\|ResourceMap\b\|ResourceRef\b" src/ include/ tests/ plugins/ examples/

Only matches are the declarations themselves.

Renames in include/methcla/engine.hpp

The actually-used class in the same conceptual area:

  • ResourceIdAllocator<Id, T>IdAllocator<Id, T>. Currently instantiated as NodeIdAllocator and AudioBusIdAllocator (public typedefs at include/methcla/engine.hpp:620-621); the typedef names are preserved, only the underlying template is renamed.

The rename is independent justification: the class is a general-purpose id allocator, not specific to any "resource" concept.

Files affected

  • src/Methcla/Audio/Resource.hpp — remove dead declarations. If the file becomes empty, delete it (and its inclusions, if any).
  • include/methcla/engine.hpp — rename ResourceIdAllocatorIdAllocator; preserve the NodeIdAllocator and AudioBusIdAllocator typedef names.

Scope

In scope: deletion + the one rename above.

Out of scope: the wider Resource system design in #147. That work depends on these names being freed up, but the cleanup stands on its own merits and can be merged independently.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions