Skip to content

[C++] Implement ObjectName equivalent for memory classes #133

Backlog

Description

@konard

Locations:

  • cpp/Platform.Memory/DirectMemoryAsArrayMemoryAdapter.h:33-36
  • cpp/Platform.Memory/FileArrayMemory.h:51-54
  • cpp/Platform.Memory/FileMappedResizableDirectMemory.h:10-13
  • cpp/Platform.Memory/HeapResizableDirectMemory.h:26-29
  • cpp/Platform.Memory/TemporaryFileMappedResizableDirectMemory.h:18-21

Current code (example):

//protected: override std::string ObjectName
//{
//    get => std::string("Heap stored memory block at ").append(Platform::Converters::To<std::string>(Pointer)).append(" address.");
//}

Problem:
In C# every memory class overrides DisposableBase.ObjectName, which is used in ObjectDisposedException messages and diagnostics. The C++ translation left these overrides as comments, so C++ objects have no readable description.

Original C# texts:

  • DirectMemoryAsArrayMemoryAdapter: Array as memory block at '{Pointer}' address.
  • FileArrayMemory: File stored memory block at '{path}' path.
  • FileMappedResizableDirectMemory: File stored memory block at '{Path}' path.
  • HeapResizableDirectMemory: Heap stored memory block at {Pointer} address.
  • TemporaryFileMappedResizableDirectMemory: Temporary file stored memory block at '{Path}' path.

Suggestion:
Provide an idiomatic C++ equivalent (for example a std::string ObjectName() const member, or operator<</std::formatter specializations) with these texts, use it in error messages, and add tests.


Converted from commented-out code as part of #15.

Activity

  1. added
    enhancement
    on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions