Class Backend

Inheritance Relationships

Derived Types

Class Documentation

class switchml::Backend

An interface that describes the backend.

A backend is the class responsible for creating worker threads and actually carrying out the jobs submitted by performing the communication.

Subclassed by switchml::DpdkBackend, switchml::DummyBackend, switchml::RdmaBackend

Public Functions

~Backend() = default
Backend(Backend const&) = delete
void operator=(Backend const&) = delete
Backend(Backend&&) = default
Backend &operator=(Backend&&) = default
virtual void SetupWorker() = 0

Initializes backend specific variables and starts worker threads.

See

CleanupWorker()

virtual void CleanupWorker() = 0

Cleans up all worker state and waits for the worker threads to exit.

See

SetupWorker()

Public Static Functions

static std::unique_ptr<Backend> CreateInstance(Context &context, Config &config)

Factory function to create a backend instance based on the configuration passed.

Parameters
  • context[in] a reference to the switchml context.

  • config[in] a reference to the switchml configuration.

Returns

std::unique_ptr<Backend> a unique pointer to the created backend object.

Protected Functions

Backend(Context &context, Config &config)

Initializes the members with the passed references.

Must be called explicitly by all subclass constructors.

Parameters
  • context[in] The context

  • config[in] The context configuration.

Protected Attributes

Context &context_

A reference to the context

Config &config_

A reference to the context configuration