Skip to content
Snippets Groups Projects
Commit 44d60120 authored by Christian Gutsche's avatar Christian Gutsche
Browse files

better readme

parent 2a80158e
Branches
Tags
No related merge requests found
......@@ -3,63 +3,63 @@
### How to Start
To load the Module, add
'include("<<location of context.jl file>>")'
`include("<<location of context.jl file>>")`
to your script.
If your script is located just in this dir, use the following (in Windows):
'include("./context.jl")'
`include("./context.jl")`
'using .context'
`using .context`
Will then add all the function listed below to the namespace.
With
'import .context'
`import .context`
e.g. you have to write context.getRoles().
### Some Background Structures
'Context'
`Context`
An abstract type. Will be super type of concrete context types.
'Role'
`Role`
An abstract type. Will be super type of concrete role types.
'ContextManagement'
`ContextManagement`
A data base for all contexts and roles that are defined and active.
### Available Functions and Macros
'@newContext <<Context Name>>'
Creates a new Type '<<Context Name>>ContextType' and an Object '<<Context Name>>' of this type
`@newContext <<Context Name>>`
Creates a new Type `<<Context Name>>ContextType` and an Object `<<Context Name>>` of this type
'@newRole <<Role Name>> <<List of Attributes>> <<Context, role lives in>> <<Type, role can be assigned to>>'
Creates a new Struct '<<Role Name>>' with the Attributes defined in '<<List of Attributes>>'
`@newRole <<Role Name>> <<List of Attributes>> <<Context, role lives in>> <<Type, role can be assigned to>>`
Creates a new Struct `<<Role Name>>` with the Attributes defined in `<<List of Attributes>>`
'@context <<Context Name>> <<function Definition>>'
Creates a function, specifically defined for the context <<Context Name>>. Note that, the variable 'context' will be available inside the function by default.
`@context <<Context Name>> <<function Definition>>`
Creates a function, specifically defined for the context <<Context Name>>. Note that, the variable `context` will be available inside the function by default.
'@context <<Context Name>> <<function call>>'
Calls a function, that was defined via '@context <<Context Name>> <<function Definition>>'. Note that, the variable 'context' will be available inside the function by default.
`@context <<Context Name>> <<function call>>`
Calls a function, that was defined via `@context <<Context Name>> <<function Definition>>`. Note that, the variable `context` will be available inside the function by default.
'assignRole(<<Type>> => <<Role Name>>(<<Role Attributes>>), <<Context Name>>)'
'@context <<Context Name>> assignRole(<<Type>> => <<Role Name>>(<<Role Attributes>>))'
`assignRole(<<Type>> => <<Role Name>>(<<Role Attributes>>), <<Context Name>>)`
`@context <<Context Name>> assignRole(<<Type>> => <<Role Name>>(<<Role Attributes>>))`
Assigns a Role <<Role Name>> to a <<Type>> in the context <<Context Name>>
'disassignRole(<<Type>> => <<Role Name>>(<<Role Attributes>>), <<Context Name>>)'
'@context <<Context Name>> disassignRole(<<Type>> => <<Role Name>>(<<Role Attributes>>))'
`disassignRole(<<Type>> => <<Role Name>>(<<Role Attributes>>), <<Context Name>>)`
`@context <<Context Name>> disassignRole(<<Type>> => <<Role Name>>(<<Role Attributes>>))`
Disassigns a Role <<Role Name>> to a <<Type>> in the context <<Context Name>>
getContexts()
`getContexts()`
Returns a list of all defined Contexts.
getRoles()
Returns a 'Dict{Context, Dict{Any, Vector{DataType}}}' of all defined Roles. E.g.: {<<Context Name 1>> => {<<Class Name 1>> => [<<Role 1>>], <<Class Name 2>> => [<<Role 2>>]}, <<Context Name 2>>=>{<<Class Name 1>> => [<<Role 3>>, <<Role 4>>]}}
`getRoles()`
Returns a `Dict{Context, Dict{Any, Vector{DataType}}}` of all defined Roles. E.g.: {<<Context Name 1>> => {<<Class Name 1>> => [<<Role 1>>], <<Class Name 2>> => [<<Role 2>>]}, <<Context Name 2>>=>{<<Class Name 1>> => [<<Role 3>>, <<Role 4>>]}}
getRoles(<<Object Name>>)
Returns a 'Dict{Context, DataType}' for a specific object <<Object Name>>.
`getRoles(<<Object Name>>)`
Returns a `Dict{Context, DataType}` for a specific object <<Object Name>>.
getRole(<<Object Name>>, <<Context Name>>)
`getRole(<<Object Name>>, <<Context Name>>)`
Returns the Role, that <<Object Name>> is playing in the context <<Context Name>>.
### Example
For an Example, look into 'contextExample.jl'
\ No newline at end of file
For an Example, look into `contextExample.jl`
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment