tensorflow::EnvWrapper

#include <env.h>

An implementation of Env that forwards all calls to another Env.

Summary

May be useful to clients who wish to override just part of the functionality of another Env.

Inheritance

Inherits from: tensorflow::Env

Constructors and Destructors

EnvWrapper(Env *t)
Initializes an EnvWrapper that delegates all calls to *t.
~EnvWrapper()

Public functions

GetFileSystemForFile(const string & fname, FileSystem **result) override
virtual Status
Returns the FileSystem object to handle operations on the file specified by 'fname'.
GetRegisteredFileSystemSchemes(std::vector< string > *schemes) override
virtual Status
Returns the file system schemes registered for this Env.
GetSymbolFromLibrary(void *handle, const char *symbol_name, void **symbol) override
virtual Status
LoadLibrary(const char *library_filename, void **handle) override
virtual Status
MatchPath(const string & path, const string & pattern) override
virtual bool
Returns true if the path matches the given pattern.
NowMicros() override
virtual uint64
Returns the number of micro-seconds since some fixed point in time.
RegisterFileSystem(const string & scheme, FileSystemRegistry::Factory factory) override
virtual Status
SchedClosure(std::function< void()> closure) override
virtual void
SchedClosureAfter(int64 micros, std::function< void()> closure) override
virtual void
SleepForMicroseconds(int64 micros) override
virtual void
Sleeps/delays the thread for the prescribed number of micro-seconds.
StartThread(const ThreadOptions & thread_options, const string & name, std::function< void()> fn) override
virtual Thread *
Returns a new thread that is running fn() and is identified (for debugging/performance-analysis) by "name".
target() const
Env *
Returns the target to which this Env forwards all calls.

Public functions

EnvWrapper

 EnvWrapper(
  Env *t
)

Initializes an EnvWrapper that delegates all calls to *t.

GetFileSystemForFile

virtual Status GetFileSystemForFile(
  const string & fname,
  FileSystem **result
) override

Returns the FileSystem object to handle operations on the file specified by 'fname'.

The FileSystem object is used as the implementation for the file system related (non-virtual) functions that follow. Returned FileSystem object is still owned by the Env object and will

GetRegisteredFileSystemSchemes

virtual Status GetRegisteredFileSystemSchemes(
  std::vector< string > *schemes
) override

Returns the file system schemes registered for this Env.

GetSymbolFromLibrary

virtual Status GetSymbolFromLibrary(
  void *handle,
  const char *symbol_name,
  void **symbol
) override

LoadLibrary

virtual Status LoadLibrary(
  const char *library_filename,
  void **handle
) override

MatchPath

virtual bool MatchPath(
  const string & path,
  const string & pattern
) override

Returns true if the path matches the given pattern.

The wildcards allowed in pattern are described below (GetMatchingPaths).

NowMicros

virtual uint64 NowMicros() override

Returns the number of micro-seconds since some fixed point in time.

Only useful for computing deltas of time.

RegisterFileSystem

virtual Status RegisterFileSystem(
  const string & scheme,
  FileSystemRegistry::Factory factory
) override

SchedClosure

virtual void SchedClosure(
  std::function< void()> closure
) override

SchedClosureAfter

virtual void SchedClosureAfter(
  int64 micros,
  std::function< void()> closure
) override

SleepForMicroseconds

virtual void SleepForMicroseconds(
  int64 micros
) override

Sleeps/delays the thread for the prescribed number of micro-seconds.

StartThread

virtual Thread * StartThread(
  const ThreadOptions & thread_options,
  const string & name,
  std::function< void()> fn
) override

Returns a new thread that is running fn() and is identified (for debugging/performance-analysis) by "name".

Caller takes ownership of the result and must delete it eventually (the deletion will block until fn() stops running).

target

Env * target() const 

Returns the target to which this Env forwards all calls.

~EnvWrapper

virtual  ~EnvWrapper()