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

Implement Xios handler as a singleton #763

Open
wants to merge 7 commits into
base: issue756_xios-calendar-increment
Choose a base branch
from

Conversation

jwallwork23
Copy link
Contributor

@jwallwork23 jwallwork23 commented Jan 2, 2025

Note that this PR merges into the branch for #757, not develop.

This PR implements the Xios handler object as a singleton, as requested. This means that nextSIM-DG classes don't need to own pointers to the current working Xios instance. There can be only one Xios instance. The first time the static Xios::getInstance method is called, it creates the singleton and returns a pointer to it. On subsequent calls, this method simply returns a pointer to the singleton.

Unfortunately, I had to rework the XIOS read/write test. The singleton design pattern isn't suitable for the way it's currently written, so I re-separated out the reading and writing parts and re-combined the 2D and 3D cases.

@jwallwork23 jwallwork23 added the enhancement New feature or request label Jan 2, 2025
@jwallwork23 jwallwork23 self-assigned this Jan 2, 2025
@jwallwork23 jwallwork23 added the ICCS Tasks or reviews for the ICCS team label Jan 2, 2025
Copy link
Contributor

@TomMelt TomMelt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jwallwork23, looks good to me. I have tested it locally and all tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ICCS Tasks or reviews for the ICCS team
Projects
Status: Review required
Development

Successfully merging this pull request may close these issues.

2 participants