Real Time Open Sound Control librtosc: rtosc::savefile_dispatcher_t Class Reference

Real Time Open Sound Control librtosc

Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
rtosc::savefile_dispatcher_t Class Reference

Class to modify and dispatch messages loaded from savefiles. More...

`#include <savefile.h>`

## Protected Types
enum | proceed { abort = -2 , discard = -1 }
enum | dependency_t { no_dependencies , has_dependencies , not_specified }

## Protected Member Functions
bool | operator() (const char *msg)
| call this to dispatch a message

## Static Protected Member Functions
static int | default_response (size_t nargs, bool first_round, dependency_t dependency)

## Protected Attributes
rtosc_version | rtosc_filever
| rtosc versinon savefile was written with
rtosc_version | rtosc_curver
| rtosc version of this library
rtosc_version | app_filever
| app version savefile was written with
rtosc_version | app_curver
| current app version

## Friends
int | dispatch_printed_messages (const char *messages, const struct Ports &ports, void *runtime, savefile_dispatcher_t *dispatcher)
| Scan OSC messages from human readable format and dispatch them. More...
int | load_from_file (const char *file_content, const struct Ports &ports, void *runtime, const char *appname, rtosc_version appver, savefile_dispatcher_t *dispatcher)
| Read save file and dispatch contained parameters. More...

## Detailed Description

Class to modify and dispatch messages loaded from savefiles.

Objects of this class shall be passed to savefile loading routines. You can inherit to change the behaviour, e.g. to modify or discard such messages.

## Member Enumeration Documentation

## ◆ dependency_t

enum rtosc::savefile_dispatcher_t::dependency_t
| protected

Enumerator
has_dependencies | default values don't depend on others
not_specified | default values do depend on others it's not know which of the other enum values fit

## ◆ proceed

enum rtosc::savefile_dispatcher_t::proceed
| protected

Enumerator
abort | the message shall lead to abort the savefile loading
discard | the message shall not be dispatched

## Friends And Related Function Documentation

## ◆ dispatch_printed_messages

int dispatch_printed_messages | ( | const char * | messages,
|  | const struct Ports & | ports,
|  | void * | runtime,
|  | savefile_dispatcher_t * | dispatcher
| ) |  |
| friend

Scan OSC messages from human readable format and dispatch them.

Parameters

  messages | The OSC messages, whitespace-separated
  ports | The static ports structure
  runtime | The runtime object
  dispatcher | Object to modify messages prior to dispatching, or NULL. You can overwrite its virtual functions, and you should specify any of the version structs if needed. All other members shall not be initialized.

Returns
  The number of messages read, or, if there was a read error, or the dispatcher did refuse to dispatch, the number of bytes read until the read error occured minus one

## ◆ load_from_file

int load_from_file | ( | const char * | file_content,
|  | const struct Ports & | ports,
|  | void * | runtime,
|  | const char * | appname,
|  | rtosc_version | appver,
|  | savefile_dispatcher_t * | dispatcher
| ) |  |
| friend

Read save file and dispatch contained parameters.

Parameters

  file_content | The file as a C string
  ports | The static ports structure
  runtime | The runtime object
  appname | Name of the application calling this function; must match the file's application name
  appver | Version of the application calling this function
  dispatcher | Modifier for the messages; NULL if no modifiers are needed

Returns
  The number of messages read, or, if there was a read error, the negated number of bytes read until the read error occured minus one

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

- /build/rtosc/src/rtosc-0.3.1/include/rtosc/savefile.h