diff options
| author | Mark Rowe <mark@vector35.com> | 2025-08-11 15:45:38 -0700 |
|---|---|---|
| committer | Mark Rowe <mark@vector35.com> | 2025-08-20 13:06:33 -0400 |
| commit | ff72f3be107e94a0be41a1e7ba113000a4e95089 (patch) | |
| tree | 1dec15cea9d5b8e5609b1006638fc5cea2eda974 /binaryninjaapi.h | |
| parent | e15b6e8789bd791a201bdac031561dddb59a99e4 (diff) | |
Deprecate Workflow::Instance in favor of Workflow::Get and Workflow::GetOrCreate
Calls to `Workflow::Instance` that were looking up a built-in workflow
name are updated to use `Workflow::Get`. Others use `Workflow::GetOrCreate`.
Diffstat (limited to 'binaryninjaapi.h')
| -rw-r--r-- | binaryninjaapi.h | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 93117eb8..589556f1 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -11307,13 +11307,43 @@ namespace BinaryNinja { */ static std::vector<Ref<Workflow>> GetList(); - /*! Get an instance of a workflow by name. If it is already registered, this will return the registered Workflow. - If not, it will create and return a new Workflow. + /*! Get an instance of an existing registered workflow by name. + If no registered workflow exists, nullptr will be returned. + + \note Be sure to handle the nullptr case if you're retrieving + anything other than a built-in workflow. \param name Workflow name - \return The registered workflow. + \return The registered workflow, or nullptr if none exists. */ - static Ref<Workflow> Instance(const std::string& name = ""); + static Ref<Workflow> Get(const std::string& name); + + /*! Get an instance of a workflow by name. If it is already registered, + this will return the registered Workflow. If not, a new Workflow will + be created and returned. + + \note If a new workflow is returned it will have no activities. Attempting + to register new activities on it via `Insert` and `InsertAfter` will fail. + + \param name Workflow name + \return The workflow. + */ + static Ref<Workflow> GetOrCreate(const std::string& name); + + /*! Get an instance of a workflow by name. If it is already registered, + this will return the registered Workflow. If not, a new Workflow will + be created and returned. + + \deprecated Use `Get` or `GetOrCreate` instead. + + \note If a new workflow is returned it will have no activities. Attempting + to register new activities on it via `Insert` and `InsertAfter` will fail. + + \param name Workflow name + \return The workflow. + */ + static Ref<Workflow> Instance(const std::string& name = "") { return GetOrCreate(name); } + /*! Register a workflow, making it immutable and available for use \param workflow The workflow to register |
