Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simply access-permissions-related code #639

Closed
eyalroz opened this issue Apr 12, 2024 · 0 comments
Closed

Simply access-permissions-related code #639

eyalroz opened this issue Apr 12, 2024 · 0 comments

Comments

@eyalroz
Copy link
Owner

eyalroz commented Apr 12, 2024

The memory::access_permissions_t structure can be much simpler. Users should not need to use it directly themselves, just pass it to functions of this library. So, let's just make it a:

struct access_permissions_t {
	bool read;
	bool write;
};

with some named constructor idioms... not as static methods. We could also probably get rid of the enum : bool type, add an access sub-namespace, and have memory::permissions::read_only(), memory::permissions::write_only(), memory::permissions::read_and_write() and memory::permissions::none().

(and maybe even shorten access_permissions() to permissions()?)

@eyalroz eyalroz added the task label Apr 12, 2024
@eyalroz eyalroz changed the title Simply the access_permissions_t structure Simply access-permissions-related code Apr 23, 2024
eyalroz added a commit that referenced this issue Apr 23, 2024
* Renamed: `access_permissions` -> `permissions` and `access_permissions_t` to `permissions_t`, everwhere
* Dropped the boolean enum in favor of parameter-less some named constructor idioms
* Dropped the static methods in favor of named constructor idioms
* No user code needs to worry about pairs-of-booleans; but they can aggregate-initialize if they really want to
eyalroz added a commit that referenced this issue Apr 23, 2024
* Renamed: `access_permissions` -> `permissions` and `access_permissions_t` to `permissions_t`, everwhere
* Dropped the boolean enum in favor of parameter-less some named constructor idioms
* Dropped the static methods in favor of named constructor idioms
* No user code needs to worry about pairs-of-booleans; but they can aggregate-initialize if they really want to
eyalroz added a commit that referenced this issue Apr 24, 2024
* Renamed: `access_permissions` -> `permissions` and `access_permissions_t` to `permissions_t`, everwhere
* Dropped the boolean enum in favor of parameter-less some named constructor idioms
* Dropped the static methods in favor of named constructor idioms
* No user code needs to worry about pairs-of-booleans; but they can aggregate-initialize if they really want to
eyalroz added a commit that referenced this issue Apr 29, 2024
* Renamed: `access_permissions` -> `permissions` and `access_permissions_t` to `permissions_t`, everwhere
* Dropped the boolean enum in favor of parameter-less some named constructor idioms
* Dropped the static methods in favor of named constructor idioms
* No user code needs to worry about pairs-of-booleans; but they can aggregate-initialize if they really want to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant