TensorFlow Serving C++ API Documentation
Public Types | Public Member Functions | Static Public Member Functions | List of all members
tensorflow::serving::AspiredVersionsManagerBuilder Class Reference

#include <aspired_versions_manager_builder.h>

Public Types

using Options = AspiredVersionsManager::Options
 

Public Member Functions

template<typename S >
void AddSource (std::unique_ptr< S > source)
 
template<typename S , typename SA , typename... Args>
void AddSourceChain (std::unique_ptr< S > source, std::unique_ptr< SA > first_source_adapter, std::unique_ptr< Args >... remaining_source_adapters)
 
std::unique_ptr< ManagerBuild ()
 Builds the AspiredVersionsManager and returns it as the Manager interface.
 

Static Public Member Functions

static Status Create (Options options, std::unique_ptr< AspiredVersionsManagerBuilder > *builder)
 

Detailed Description

Builds an AspiredVersionsManager with options and sources connected to it. It takes over the ownership of the sources and the returned manager handles the destruction of itself and its dependencies. Both single sources and source/source-adapter chains are accepted, i.e. you can use sources that directly supply loaders (Source&lt;std::unique_ptr&lt;Loader>>) or composites that consist of Source&lt;S> + some chain of SourceAdapter&lt;S, ...>, ..., SourceAdapter&lt;..., std::unique_ptr&lt;Loader>>. The builder connects the chain for you.

Usage:

...
AspiredVersionsManagerBuilder::Options options = ManagerOptions();
std::unique_ptr&lt;AspiredVersionsManagerBuilder> builder;
TF_CHECK_OK(AspiredVersionsManagerBuilder::Create(
    std::move(options), &builder));
builder->AddSource(std::move(some_source));
builder->AddSourceChain(
    std::move(source), std::move(source_adapter1),
    std::move(source_adapter2));
std::unique_ptr&lt;Manager> manager = builder->Build();
...

NOTE: A builder can only be used to build a single AspiredVersionsManager.

This class is not thread-safe.

Definition at line 59 of file aspired_versions_manager_builder.h.

Member Function Documentation

◆ AddSource()

template<typename S >
void tensorflow::serving::AspiredVersionsManagerBuilder::AddSource ( std::unique_ptr< S >  source)

Connects the source to the AspiredVersionsManager being built and takes over its ownership.

REQUIRES: Template type S be convertible to Source&lt;std::unique_ptr&lt;Loader>>.

Definition at line 114 of file aspired_versions_manager_builder.h.

◆ AddSourceChain()

template<typename S , typename SA , typename... Args>
void tensorflow::serving::AspiredVersionsManagerBuilder::AddSourceChain ( std::unique_ptr< S >  source,
std::unique_ptr< SA >  first_source_adapter,
std::unique_ptr< Args >...  remaining_source_adapters 
)

Connects a chain comprising a source and a chain of source adapters, s.t. the final adapter in the chain emits Loaders for the manager. The final adapter is connected to the manager. We take ownership of the whole chain.

REQUIRES: At least one source adapter.

Usage: builder->AddSourceChain( std::move(source), std::move(source_adapter1), std::move(source_adapter2));

Definition at line 123 of file aspired_versions_manager_builder.h.


The documentation for this class was generated from the following files: