eclipse-score / eclipse-score/communication

Investigate returning pointers to const in ManagedMemoryResource public API

Open
#84 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
62
Forks
97
Avg merge
1d 1h
Merged PRs (30d)
72

Description

### What

The MangedMemoryResource public interface has functions returning pointers to non-const. Some of these functions (e.g. GetBaseAddress()) should return pointers to const, since the calling code should not be modifying the region before getUsableBaseAddress (since this is reserved for bookkeeping by the SharedMemoryResource). Other functions such as getUsableBaseAddress() should return pointer to non-const, since the calling code uses this pointer to write to shared memory.

We should check all functions in the interface returning a pointer and decide whether they should be const or non const.

DoD:
Remove suppression for autosar_cpp14_m9_3_1_violation in SharedMemoryResource::getBaseAddress()
Change ManagedMemoryResource API to return pointer to const where required.

### How

_No response_

### Estimates for realization

- Effort cannot be estimated in advance
- No impact on users expected

### Category

- [ ] Affects Detailed Design

### Requirements / Architecture

- [x] Requirements / Architecture are not affected by this change?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.