This class is used to create a storage for tidymodules objects.

Details

Manage applications, sessions and modules.

Methods


Method new()

Create a new ModStore object. Should be called once by the TidyModule class. Not to be called directly outside TidyModule. The ModStore object can be retrieved from any TidyModule object, see example below.

Usage

ModStore$new()

Returns

A new ModStore object.

Examples

MyModule <- R6::R6Class("MyModule", inherit = tidymodules::TidyModule)
m <- MyModule$new()
s <- m$getStore()


Method isStored()

Check if a module is stored in the current session.

Usage

ModStore$isStored(m)

Arguments

m

TidyModule object.

Examples

MyModule <- R6::R6Class("MyModule", inherit = tidymodules::TidyModule)
m <- MyModule$new()
s <- m$getStore()
s$isStored(m)


Method getGlobalSession()

Retrieve the global session 'global_session'. This is the session that exists outside the application server function

Usage

ModStore$getGlobalSession()


Method getSession()

Retrieve a module session. This could be the global session or a user session.

Usage

ModStore$getSession(m)

Arguments

m

TidyModule object.


Method getSessions()

Retrieve all sessions.

Usage

ModStore$getSessions()


Method getMods()

Retrieve all modules.

Usage

ModStore$getMods(m)

Arguments

m

TidyModule object.


Method getEdges()

Retrieve modules connections.

Usage

ModStore$getEdges(m)

Arguments

m

TidyModule object.


Method addEdge()

Add modules connections into ModStore. An edge is either a connection between a reactive object and a module or between two modules.

Usage

ModStore$addEdge(from, to, mode = "direct", comment = NA)

Arguments

from

list with three elements: m -> module, type -> input or output, port -> port Id.

to

list with three elements: m -> module, type -> input or output, port -> port Id.

mode

The type of edge, default to 'direct'.

comment

Any additional comment.


Method delEdges()

Remove module edges

Usage

ModStore$delEdges(m)

Arguments

m

TidyModule object.


Method addMod()

Add module into the ModStore.

Usage

ModStore$addMod(m)

Arguments

m

TidyModule object.


Method delMod()

Delete a module from the ModStore.

Usage

ModStore$delMod(m)

Arguments

m

TidyModule object.


Method print()

Print the ModStore object.

Usage

ModStore$print()


Method clone()

The objects of this class are cloneable with this method.

Usage

ModStore$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples


## ------------------------------------------------
## Method `ModStore$new`
## ------------------------------------------------

MyModule <- R6::R6Class("MyModule", inherit = tidymodules::TidyModule)
m <- MyModule$new()
s <- m$getStore()

## ------------------------------------------------
## Method `ModStore$isStored`
## ------------------------------------------------

MyModule <- R6::R6Class("MyModule", inherit = tidymodules::TidyModule)
m <- MyModule$new()
s <- m$getStore()
s$isStored(m)
#> [1] TRUE