Thanks to visit codestin.com
Credit goes to github.com

Skip to content

eliminate global variables #3

@mikejiang

Description

@mikejiang

There are currently two global variables used by cytolib (mainly for troubleshooting purpose)
https://github.com/RGLab/cytolib/blob/trunk/inst/include/cytolib/global.hpp#L30-L31

extern keyword indicates they are only the variable declaration instead of definition. Because due to the nature of header-only, cytolib can't define them in any header in order to avoid multi-definition compiling errors (when header is included multiple times).

Therefore it implicitly requires the cytolib users to define it somewhere in the user code in order for cytolib function, even if they don't necessarily need to care about this log feature.

We shouldn't force user to do this (besides it is not best practice to use global variable). Instead, we can move them into GatingSet class and initialize/change their values either through parseWorkspace call or through setter methods once GatingSet is created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions