Documentation
¶
Index ¶
- type Activation
- type Class
- func (cl *Class) Abstract() bool
- func (cl *Class) Deletable() bool
- func (cl *Class) Equal(other *Class) bool
- func (cl *Class) FindMessageHandler(name string, handlerType MessageHandlerType) (*MessageHandler, error)
- func (cl *Class) Instances() []*Instance
- func (cl *Class) MessageHandlers() []*MessageHandler
- func (cl *Class) Module() *Module
- func (cl *Class) Name() string
- func (cl *Class) NewInstance(name string, skipInit bool) (*Instance, error)
- func (cl *Class) Reactive() bool
- func (cl *Class) Slot(name string) (*ClassSlot, error)
- func (cl *Class) Slots(inherited bool) []*ClassSlot
- func (cl *Class) String() string
- func (cl *Class) Subclass(other *Class) bool
- func (cl *Class) Subclasses(inherited bool) ([]*Class, error)
- func (cl *Class) Superclass(other *Class) bool
- func (cl *Class) Superclasses(inherited bool) ([]*Class, error)
- func (cl *Class) Undefine() error
- func (cl *Class) WatchInstances(val bool)
- func (cl *Class) WatchSlots(val bool)
- func (cl *Class) WatchedInstances() bool
- func (cl *Class) WatchedSlots() bool
- type ClassDefaultsMode
- type ClassSlot
- func (cs *ClassSlot) Accessible() bool
- func (cs *ClassSlot) AllowedClasses() (values []Symbol, ok bool)
- func (cs *ClassSlot) AllowedValues() (values []interface{}, ok bool)
- func (cs *ClassSlot) Cardinality() (low int64, high int64, hasHigh bool)
- func (cs *ClassSlot) DefaultValue() interface{}
- func (cs *ClassSlot) Equal(other *ClassSlot) bool
- func (cs *ClassSlot) Facets() []Symbol
- func (cs *ClassSlot) FloatRange() (low float64, hasLow bool, high float64, hasHigh bool)
- func (cs *ClassSlot) Initable() bool
- func (cs *ClassSlot) IntRange() (low int64, hasLow bool, high int64, hasHigh bool)
- func (cs *ClassSlot) Name() string
- func (cs *ClassSlot) Public() bool
- func (cs *ClassSlot) Sources() []Symbol
- func (cs *ClassSlot) String() string
- func (cs *ClassSlot) Types() []Symbol
- func (cs *ClassSlot) Writable() bool
- type DataObject
- type Environment
- func (env *Environment) Activations() []*Activation
- func (env *Environment) AgendaChanged() bool
- func (env *Environment) AssertString(factstr string) (Fact, error)
- func (env *Environment) BatchStar(path string) error
- func (env *Environment) Build(construct string) error
- func (env *Environment) ClassDefaultsMode() ClassDefaultsMode
- func (env *Environment) Classes() []*Class
- func (env *Environment) Clear()
- func (env *Environment) ClearAgenda() error
- func (env *Environment) ClearFocus()
- func (env *Environment) CompleteCommand(cmd string) (bool, error)
- func (env *Environment) CurrentModule() *Module
- func (env *Environment) DefineFunction(name string, callback interface{}) error
- func (env *Environment) Delete()
- func (env *Environment) Eval(construct string) (interface{}, error)
- func (env *Environment) ExtractEval(retval interface{}, construct string) error
- func (env *Environment) Facts() []Fact
- func (env *Environment) FindClass(name string) (*Class, error)
- func (env *Environment) FindFunction(name string) (*Function, error)
- func (env *Environment) FindGeneric(name string) (*Generic, error)
- func (env *Environment) FindGlobal(name string) (*Global, error)
- func (env *Environment) FindInstance(name InstanceName, module string) (*Instance, error)
- func (env *Environment) FindModule(name string) (*Module, error)
- func (env *Environment) FindRule(name string) (*Rule, error)
- func (env *Environment) FindTemplate(name string) (*Template, error)
- func (env *Environment) Focus() *Module
- func (env *Environment) Functions() []*Function
- func (env *Environment) Generics() []*Generic
- func (env *Environment) Globals() []*Global
- func (env *Environment) GlobalsChanged() bool
- func (env *Environment) Insert(name string, basis interface{}, opts ...InsertClassOption) (*Instance, error)
- func (env *Environment) InsertClass(basis interface{}, opts ...InsertClassOption) (*Class, error)
- func (env *Environment) Instances() []*Instance
- func (env *Environment) InstancesChanged() bool
- func (env *Environment) Load(path string) error
- func (env *Environment) LoadFacts(filename string) error
- func (env *Environment) LoadFactsFromString(factstr string) error
- func (env *Environment) LoadInstances(filename string) error
- func (env *Environment) LoadInstancesFromString(instances string) error
- func (env *Environment) MakeInstance(command string) (*Instance, error)
- func (env *Environment) Modules() []*Module
- func (env *Environment) Refresh(module *Module)
- func (env *Environment) Reorder(module *Module)
- func (env *Environment) Reset()
- func (env *Environment) RestoreInstances(filename string) error
- func (env *Environment) RestoreInstancesFromString(instances string) error
- func (env *Environment) Rules() []*Rule
- func (env *Environment) Run(limit int64) int64
- func (env *Environment) SalienceEvaluation() SalienceEvaluation
- func (env *Environment) Save(path string, binary bool) error
- func (env *Environment) SaveFacts(filename string, savemode SaveMode) error
- func (env *Environment) SaveInstances(path string, binary bool, mode SaveMode) error
- func (env *Environment) SendCommand(cmd string) error
- func (env *Environment) SetClassDefaultsMode(mode ClassDefaultsMode)
- func (env *Environment) SetFocus(module *Module)
- func (env *Environment) SetModule(module *Module)
- func (env *Environment) SetSalienceEvaluation(val SalienceEvaluation)
- func (env *Environment) SetStrategy(strategy Strategy)
- func (env *Environment) Shell()
- func (env *Environment) Strategy() Strategy
- func (env *Environment) Templates() []*Template
- type Error
- type ErrorRouter
- func (r *ErrorRouter) Activate() error
- func (r *ErrorRouter) Deactivate() error
- func (r *ErrorRouter) Delete() error
- func (r *ErrorRouter) Exit(exitcode int)
- func (r *ErrorRouter) Getc(name string) byte
- func (r *ErrorRouter) LastMessage() string
- func (r *ErrorRouter) Name() string
- func (r *ErrorRouter) Print(name string, message string)
- func (r *ErrorRouter) Query(name string) bool
- func (r *ErrorRouter) Ungetc(name string, ch byte) error
- type Fact
- type Function
- func (f *Function) Call(arguments string) (interface{}, error)
- func (f *Function) Deletable() bool
- func (f *Function) Equal(other *Function) bool
- func (f *Function) Module() *Module
- func (f *Function) Name() string
- func (f *Function) String() string
- func (f *Function) Undefine() error
- func (f *Function) Watch(val bool)
- func (f *Function) Watched() bool
- type Generic
- func (g *Generic) Call(arguments string) (interface{}, error)
- func (g *Generic) Deletable() bool
- func (g *Generic) Equal(other *Generic) bool
- func (g *Generic) Methods() []*Method
- func (g *Generic) Module() *Module
- func (g *Generic) Name() string
- func (g *Generic) String() string
- func (g *Generic) Undefine() error
- func (g *Generic) Watch(val bool)
- func (g *Generic) Watched() bool
- type Global
- func (g *Global) Deletable() bool
- func (g *Global) Equal(other *Global) bool
- func (g *Global) Module() *Module
- func (g *Global) Name() string
- func (g *Global) SetValue(value interface{}) error
- func (g *Global) String() string
- func (g *Global) Undefine() error
- func (g *Global) Value() (interface{}, error)
- func (g *Global) Watch(val bool)
- func (g *Global) Watched() bool
- type HighlightedWriter
- func (hw *HighlightedWriter) AskForCPR()
- func (hw *HighlightedWriter) ClearTitle()
- func (hw *HighlightedWriter) CursorBackward(n int)
- func (hw *HighlightedWriter) CursorDown(n int)
- func (hw *HighlightedWriter) CursorForward(n int)
- func (hw *HighlightedWriter) CursorGoTo(row, col int)
- func (hw *HighlightedWriter) CursorUp(n int)
- func (hw *HighlightedWriter) EraseDown()
- func (hw *HighlightedWriter) EraseEndOfLine()
- func (hw *HighlightedWriter) EraseLine()
- func (hw *HighlightedWriter) EraseScreen()
- func (hw *HighlightedWriter) EraseStartOfLine()
- func (hw *HighlightedWriter) EraseUp()
- func (hw *HighlightedWriter) Flush() error
- func (hw *HighlightedWriter) HideCursor()
- func (hw *HighlightedWriter) SaveCursor()
- func (hw *HighlightedWriter) ScrollDown()
- func (hw *HighlightedWriter) ScrollUp()
- func (hw *HighlightedWriter) SetColor(fg, bg prompt.Color, bold bool)
- func (hw *HighlightedWriter) SetTitle(title string)
- func (hw *HighlightedWriter) ShowCursor()
- func (hw *HighlightedWriter) UnSaveCursor()
- func (hw *HighlightedWriter) Write(data []byte)
- func (hw *HighlightedWriter) WriteRaw(data []byte)
- func (hw *HighlightedWriter) WriteRawStr(data string)
- func (hw *HighlightedWriter) WriteStr(data string)
- type ImpliedFact
- func (f *ImpliedFact) Append(value interface{}) error
- func (f *ImpliedFact) Assert() error
- func (f *ImpliedFact) Asserted() bool
- func (f *ImpliedFact) Drop()
- func (f *ImpliedFact) Equal(otherfact Fact) bool
- func (f *ImpliedFact) Extend(values []interface{}) error
- func (f *ImpliedFact) Extract(retval interface{}) error
- func (f *ImpliedFact) ExtractSlot(retval interface{}, slotname string) error
- func (f *ImpliedFact) Index() int
- func (f *ImpliedFact) Retract() error
- func (f *ImpliedFact) Set(index int, value interface{}) error
- func (f *ImpliedFact) Slot(slotname string) (interface{}, error)
- func (f *ImpliedFact) Slots() (map[string]interface{}, error)
- func (f *ImpliedFact) String() string
- func (f *ImpliedFact) Template() *Template
- type ImpliedFactSlot
- type InsertClassOption
- type Instance
- func (inst *Instance) Class() *Class
- func (inst *Instance) Delete() error
- func (inst *Instance) Drop()
- func (inst *Instance) Equal(other *Instance) bool
- func (inst *Instance) Extract(retval interface{}) error
- func (inst *Instance) ExtractSlot(retval interface{}, name string) error
- func (inst *Instance) Name() InstanceName
- func (inst *Instance) Send(message string, arguments string) interface{}
- func (inst *Instance) SetSlot(name string, value interface{}) error
- func (inst *Instance) Slot(name string) (interface{}, error)
- func (inst *Instance) Slots(inherited bool) map[string]interface{}
- func (inst *Instance) String() string
- func (inst *Instance) Unmake() error
- type InstanceName
- type LoggingRouter
- func (r *LoggingRouter) Activate() error
- func (r *LoggingRouter) Deactivate() error
- func (r *LoggingRouter) Delete() error
- func (r *LoggingRouter) Exit(exitcode int)
- func (r *LoggingRouter) Getc(name string) byte
- func (r *LoggingRouter) Name() string
- func (r *LoggingRouter) Print(name string, message string)
- func (r *LoggingRouter) Query(name string) bool
- func (r *LoggingRouter) Ungetc(name string, ch byte) error
- type MessageHandler
- func (mh *MessageHandler) Deletable() bool
- func (mh *MessageHandler) Equal(other *MessageHandler) bool
- func (mh *MessageHandler) Name() string
- func (mh *MessageHandler) String() string
- func (mh *MessageHandler) Type() MessageHandlerType
- func (mh *MessageHandler) Undefine() error
- func (mh *MessageHandler) Watch(val bool)
- func (mh *MessageHandler) Watched() bool
- type MessageHandlerType
- type Method
- type Module
- type NotFoundError
- type Router
- type RouterCore
- type Rule
- func (r *Rule) AddBreakpoint()
- func (r *Rule) Deletable() bool
- func (r *Rule) Equal(other *Rule) bool
- func (r *Rule) Matches(verbosity Verbosity) ([]interface{}, error)
- func (r *Rule) Module() *Module
- func (r *Rule) Name() string
- func (r *Rule) Refresh() error
- func (r *Rule) RemoveBreakpoint() error
- func (r *Rule) String() string
- func (r *Rule) Undefine() error
- func (r *Rule) WatchActivations(val bool)
- func (r *Rule) WatchFirings(val bool)
- func (r *Rule) WatchedActivations() bool
- func (r *Rule) WatchedFirings() bool
- type SalienceEvaluation
- type SaveMode
- type ShellContext
- type Strategy
- type Symbol
- type Template
- func (t *Template) Deletable() bool
- func (t *Template) Equal(other *Template) bool
- func (t *Template) Implied() bool
- func (t *Template) Module() *Module
- func (t *Template) Name() string
- func (t *Template) NewFact() (Fact, error)
- func (t *Template) Slots() map[string]*TemplateSlot
- func (t *Template) String() string
- func (t *Template) Undefine() error
- func (t *Template) Watch(val bool)
- func (t *Template) Watched() bool
- type TemplateFact
- func (f *TemplateFact) Assert() error
- func (f *TemplateFact) Asserted() bool
- func (f *TemplateFact) Drop()
- func (f *TemplateFact) Equal(otherfact Fact) bool
- func (f *TemplateFact) Extract(retval interface{}) error
- func (f *TemplateFact) ExtractSlot(retval interface{}, name string) error
- func (f *TemplateFact) Index() int
- func (f *TemplateFact) Retract() error
- func (f *TemplateFact) Set(slot string, value interface{}) error
- func (f *TemplateFact) Slot(name string) (interface{}, error)
- func (f *TemplateFact) Slots() (map[string]interface{}, error)
- func (f *TemplateFact) String() string
- func (f *TemplateFact) Template() *Template
- type TemplateSlot
- func (ts *TemplateSlot) AllowedValues() (values []interface{}, ok bool)
- func (ts *TemplateSlot) Cardinality() (low int64, high int64, hasHigh bool)
- func (ts *TemplateSlot) DefaultType() TemplateSlotDefaultType
- func (ts *TemplateSlot) DefaultValue() interface{}
- func (ts *TemplateSlot) Equal(other *TemplateSlot) bool
- func (ts *TemplateSlot) FloatRange() (low float64, hasLow bool, high float64, hasHigh bool)
- func (ts *TemplateSlot) IntRange() (low int64, hasLow bool, high int64, hasHigh bool)
- func (ts *TemplateSlot) Multifield() bool
- func (ts *TemplateSlot) Name() string
- func (ts *TemplateSlot) String() string
- func (ts *TemplateSlot) Types() []Symbol
- type TemplateSlotDefaultType
- type Type
- type Verbosity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Activation ¶
type Activation struct {
// contains filtered or unexported fields
}
Activation represents an activation from the agenda
func (*Activation) Equal ¶
func (a *Activation) Equal(other *Activation) bool
Equal returns true if other activation represents the same CLIPS activation as this one
func (*Activation) Name ¶
func (a *Activation) Name() string
Name returns the name of the rule of this activation
func (*Activation) Remove ¶
func (a *Activation) Remove() error
Remove removes this activation from the agenda. Renamed from "delete" to avoid confusion with other Deletes which always only drop references to CLIPS
func (*Activation) Salience ¶
func (a *Activation) Salience() int
Salience returns the salience value for this activation
func (*Activation) SetSalience ¶
func (a *Activation) SetSalience(salience int)
SetSalience modifies the salience of this activation
func (*Activation) String ¶
func (a *Activation) String() string
type Class ¶
type Class struct {
// contains filtered or unexported fields
}
Class is a reference to a CLIPS class
func (*Class) Deletable ¶
Deletable returns true if the class is unreferenced and therefore deletable
func (*Class) FindMessageHandler ¶
func (cl *Class) FindMessageHandler(name string, handlerType MessageHandlerType) (*MessageHandler, error)
FindMessageHandler returns a reference to the named message handler
func (*Class) MessageHandlers ¶
func (cl *Class) MessageHandlers() []*MessageHandler
MessageHandlers returns a list of all message handlers for this class
func (*Class) NewInstance ¶
NewInstance creates an instance of this class. If skipInit is true, a new, uninitialized instance of this class. Slots will be unset until the caller calls SetSlot on each one, or calls (initialize-instance [instname])
func (*Class) Slots ¶
Slots returns a list of all slots for this class. inhereted determines whether inhereted slots are included
func (*Class) Subclasses ¶
Subclasses returns the list of subclasses of this class
func (*Class) Superclass ¶
Superclass returns true if this class is a superclass of the given one
func (*Class) Superclasses ¶
Superclasses returns the list of superclasses of this class
func (*Class) WatchInstances ¶
WatchInstances sets whether instances of this class should be watched
func (*Class) WatchSlots ¶
WatchSlots sets whether instances of this class should be watched
func (*Class) WatchedInstances ¶
WatchedInstances returns true if the class instances are being watched
func (*Class) WatchedSlots ¶
WatchedSlots returns true if the class slots are being watched
type ClassDefaultsMode ¶
type ClassDefaultsMode int
ClassDefaultsMode defines the mode for defaults in a class
const ( CONVENIENCE_MODE ClassDefaultsMode = iota CONSERVATION_MODE )
func (ClassDefaultsMode) CVal ¶
func (sm ClassDefaultsMode) CVal() C.ushort
CVal returns the value as appropriate for a C call
func (ClassDefaultsMode) String ¶
func (sm ClassDefaultsMode) String() string
type ClassSlot ¶
type ClassSlot struct {
// contains filtered or unexported fields
}
ClassSlot is a reference to a slot within a particular class
func (*ClassSlot) Accessible ¶
Accessible returns true if the slot is accessible
func (*ClassSlot) AllowedClasses ¶
AllowedClasses returns the names of allowed classes for this slot, if specified. Equivalent to slot-allowed-classes
func (*ClassSlot) AllowedValues ¶
AllowedValues returns the set of allowed values for this slot, if specified
func (*ClassSlot) Cardinality ¶
Cardinality returns the cardinality for the slot
func (*ClassSlot) DefaultValue ¶
func (cs *ClassSlot) DefaultValue() interface{}
DefaultValue returns a default value for the slot. (This might be a new, unique value for DYNAMIC_DEFAULT defaults)
func (*ClassSlot) Equal ¶
Equal returns true if this slot represents the same CLIPS slot as the other slot
func (*ClassSlot) FloatRange ¶
FloatRange returns the numeric range for the slot for floating point values - e.g. low, haslow, high, hashigh := ts.Range()
func (*ClassSlot) IntRange ¶
IntRange returns the numeric range for the slot for integer values - e.g. low, haslow, high, hashigh := ts.Range()
func (*ClassSlot) Sources ¶
Sources returns a list of names of class sources for this slot. Equivalent to slot-sources
type DataObject ¶
type DataObject struct {
// contains filtered or unexported fields
}
DataObject wraps a CLIPS data object
func (*DataObject) ExtractValue ¶
func (do *DataObject) ExtractValue(retval interface{}, extractClasses bool) error
ExtractValue attempts to put the represented data value into the item provided by the user.
func (*DataObject) MustExtractValue ¶
func (do *DataObject) MustExtractValue(retval interface{}, extractClasses bool)
MustExtractValue attempts to put the represented data value into the item provided by the user, and panics if it can't
func (*DataObject) SetValue ¶
func (do *DataObject) SetValue(value interface{})
SetValue copies the go value into the dataobject
func (*DataObject) Value ¶
func (do *DataObject) Value() interface{}
Value returns the Go value for this data object
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
Environment stores a CLIPS environment
func CreateEnvironment ¶
func CreateEnvironment() *Environment
CreateEnvironment creates a new instance of a CLIPS environment
func (*Environment) Activations ¶
func (env *Environment) Activations() []*Activation
Activations returns the list of activations in the agenda
func (*Environment) AgendaChanged ¶
func (env *Environment) AgendaChanged() bool
AgendaChanged returns true if any rule activation changes have occurred since last call
func (*Environment) AssertString ¶
func (env *Environment) AssertString(factstr string) (Fact, error)
AssertString asserts a fact as a string.
func (*Environment) BatchStar ¶
func (env *Environment) BatchStar(path string) error
BatchStar executes the CLIPS code found in path. Equivalent to CLIPS (batch*)
func (*Environment) Build ¶
func (env *Environment) Build(construct string) error
Build builds a single construct within the CLIPS environment
func (*Environment) ClassDefaultsMode ¶
func (env *Environment) ClassDefaultsMode() ClassDefaultsMode
ClassDefaultsMode returns the current class defaults mode. Equivalent to (get-class-defaults-mode)
func (*Environment) Classes ¶
func (env *Environment) Classes() []*Class
Classes returns the set of defined classes
func (*Environment) ClearAgenda ¶
func (env *Environment) ClearAgenda() error
ClearAgenda deletes all activations in the agenda
func (*Environment) ClearFocus ¶
func (env *Environment) ClearFocus()
ClearFocus removes all modules from the focus stack
func (*Environment) CompleteCommand ¶
func (env *Environment) CompleteCommand(cmd string) (bool, error)
CompleteCommand checks the string to see if it is a complete command yet
func (*Environment) CurrentModule ¶
func (env *Environment) CurrentModule() *Module
CurrentModule returns the current module of the env
func (*Environment) DefineFunction ¶
func (env *Environment) DefineFunction(name string, callback interface{}) error
DefineFunction defines a Go function within the CLIPS environment. If the given name is "", the name of the go funciton will be used
func (*Environment) Eval ¶
func (env *Environment) Eval(construct string) (interface{}, error)
Eval evaluates an expression returning its value
func (*Environment) ExtractEval ¶
func (env *Environment) ExtractEval(retval interface{}, construct string) error
ExtractEval evaluates an expression, storing its return value into the object passed by the user
func (*Environment) Facts ¶
func (env *Environment) Facts() []Fact
Facts returns a slice of all facts known to CLIPS
func (*Environment) FindClass ¶
func (env *Environment) FindClass(name string) (*Class, error)
FindClass returns a reference to the given class
func (*Environment) FindFunction ¶
func (env *Environment) FindFunction(name string) (*Function, error)
FindFunction returns the function of the given name
func (*Environment) FindGeneric ¶
func (env *Environment) FindGeneric(name string) (*Generic, error)
FindGeneric returns the generic identified by name
func (*Environment) FindGlobal ¶
func (env *Environment) FindGlobal(name string) (*Global, error)
FindGlobal finds the global by name
func (*Environment) FindInstance ¶
func (env *Environment) FindInstance(name InstanceName, module string) (*Instance, error)
FindInstance returns the instance of the given name. module may be the empty string to use the current module
func (*Environment) FindModule ¶
func (env *Environment) FindModule(name string) (*Module, error)
FindModule returns the module with the given name
func (*Environment) FindRule ¶
func (env *Environment) FindRule(name string) (*Rule, error)
FindRule returns the rule of the given name
func (*Environment) FindTemplate ¶
func (env *Environment) FindTemplate(name string) (*Template, error)
FindTemplate returns an object representing the given template name
func (*Environment) Focus ¶
func (env *Environment) Focus() *Module
Focus returns the module associated with the current focus
func (*Environment) Functions ¶
func (env *Environment) Functions() []*Function
Functions returns the set of all functions in CLIPS
func (*Environment) Generics ¶
func (env *Environment) Generics() []*Generic
Generics returns a list of all generics in CLIPS
func (*Environment) Globals ¶
func (env *Environment) Globals() []*Global
Globals returns a slice containing references to all globals
func (*Environment) GlobalsChanged ¶
func (env *Environment) GlobalsChanged() bool
GlobalsChanged returns true if any global has changed since last call
func (*Environment) Insert ¶
func (env *Environment) Insert(name string, basis interface{}, opts ...InsertClassOption) (*Instance, error)
Insert inserts the given object as a shadow instance in CLIPS. A shadow class will be created if it does not already exist
func (*Environment) InsertClass ¶
func (env *Environment) InsertClass(basis interface{}, opts ...InsertClassOption) (*Class, error)
InsertClass creates a representation of a Go struct as a CLIPS defclass
func (*Environment) Instances ¶
func (env *Environment) Instances() []*Instance
Instances returns all defined instances
func (*Environment) InstancesChanged ¶
func (env *Environment) InstancesChanged() bool
InstancesChanged returns true if any instance has changed
func (*Environment) Load ¶
func (env *Environment) Load(path string) error
Load loads a set of constructs into the CLIPS data base. Constructs can be in text or binary format. Equivalent to CLIPS (load)
func (*Environment) LoadFacts ¶
func (env *Environment) LoadFacts(filename string) error
LoadFacts loads facts from the given file
func (*Environment) LoadFactsFromString ¶
func (env *Environment) LoadFactsFromString(factstr string) error
LoadFactsFromString loads facts from the given string
func (*Environment) LoadInstances ¶
func (env *Environment) LoadInstances(filename string) error
LoadInstances loads a set of instances into the CLIPS database. Equivalent to the load-instances command
func (*Environment) LoadInstancesFromString ¶
func (env *Environment) LoadInstancesFromString(instances string) error
LoadInstancesFromString loads a set of instances into the CLIPS database. Equivalent to the load-instances command
func (*Environment) MakeInstance ¶
func (env *Environment) MakeInstance(command string) (*Instance, error)
MakeInstance creates and initializes an instance of a user-defined class. Equivalent to make-instance Command must be a string in the form ([<instance-name>] of <class-name> <slot-override>*) <slot-override> :== (<slot-name> <constant>*)
func (*Environment) Modules ¶
func (env *Environment) Modules() []*Module
Modules returns the list of modulesb
func (*Environment) Refresh ¶
func (env *Environment) Refresh(module *Module)
Refresh recomputes the salience values of the Activations on the Agenda. If module is nil, the current module is used. To be called after changing the conflict resoution strategy
func (*Environment) Reorder ¶
func (env *Environment) Reorder(module *Module)
Reorder reorders the activations in the agenda. If module is nil, the current module is used. To be called after changing the conflict resoution strategy
func (*Environment) RestoreInstances ¶
func (env *Environment) RestoreInstances(filename string) error
RestoreInstances loads a set of instances into CLIPS, bypassing message handling. Intended for use with save. Equivalent to restore-isntances command
func (*Environment) RestoreInstancesFromString ¶
func (env *Environment) RestoreInstancesFromString(instances string) error
RestoreInstancesFromString loads a set of instances into CLIPS, bypassing message handling. Intended for use with save. Equivalent to restore-isntances command
func (*Environment) Rules ¶
func (env *Environment) Rules() []*Rule
Rules returns the list of all rules in the CLIPS environment
func (*Environment) Run ¶
func (env *Environment) Run(limit int64) int64
Run runs the activations in the agenda. If limit is not negative, only the first activations up to the limit will be run
func (*Environment) SalienceEvaluation ¶
func (env *Environment) SalienceEvaluation() SalienceEvaluation
SalienceEvaluation returns the salience evaulation behavior
func (*Environment) Save ¶
func (env *Environment) Save(path string, binary bool) error
Save saves the current state of the environment
func (*Environment) SaveFacts ¶
func (env *Environment) SaveFacts(filename string, savemode SaveMode) error
SaveFacts saves facts to the given file
func (*Environment) SaveInstances ¶
func (env *Environment) SaveInstances(path string, binary bool, mode SaveMode) error
SaveInstances saves the instances in the system to the specified file. If binary is true, instances will be aaved in binary format. Equivalent to save-instances
func (*Environment) SendCommand ¶
func (env *Environment) SendCommand(cmd string) error
SendCommand evaluates a command as if it were typed in the CLIPS shell
func (*Environment) SetClassDefaultsMode ¶
func (env *Environment) SetClassDefaultsMode(mode ClassDefaultsMode)
SetClassDefaultsMode sets the class defaults mode
func (*Environment) SetFocus ¶
func (env *Environment) SetFocus(module *Module)
SetFocus sets the current focus to the given module
func (*Environment) SetModule ¶
func (env *Environment) SetModule(module *Module)
SetModule sets the current module for the CLIPS env
func (*Environment) SetSalienceEvaluation ¶
func (env *Environment) SetSalienceEvaluation(val SalienceEvaluation)
SetSalienceEvaluation sets the salience evaluation behavior
func (*Environment) SetStrategy ¶
func (env *Environment) SetStrategy(strategy Strategy)
SetStrategy sets the conflict resolution strategy
func (*Environment) Shell ¶
func (env *Environment) Shell()
Shell sets up an interactive CLIPS shell within the given environment
func (*Environment) Strategy ¶
func (env *Environment) Strategy() Strategy
Strategy returns the current conflict resolution strategy
func (*Environment) Templates ¶
func (env *Environment) Templates() []*Template
Templates returns a slice of all defined templates
type Error ¶
Error error returned from CLIPS
func EnvError ¶
func EnvError(env *Environment, msg string, args ...interface{}) *Error
EnvError return an error that came from CLIPS
type ErrorRouter ¶
type ErrorRouter struct {
// contains filtered or unexported fields
}
ErrorRouter is a router that puts messages into go logging
func CreateErrorRouter ¶
func CreateErrorRouter(env *Environment) *ErrorRouter
CreateErrorRouter returns a new error accumulation router
func (*ErrorRouter) Activate ¶
func (r *ErrorRouter) Activate() error
Activate activates this router with the Env
func (*ErrorRouter) Deactivate ¶
func (r *ErrorRouter) Deactivate() error
Deactivate deactivates this router with the Env
func (*ErrorRouter) Delete ¶
func (r *ErrorRouter) Delete() error
Delete removes this router from the Env
func (*ErrorRouter) Exit ¶
func (r *ErrorRouter) Exit(exitcode int)
Exit is called by CLIPS before CLIPS itself exits
func (*ErrorRouter) Getc ¶
func (r *ErrorRouter) Getc(name string) byte
Getc is called by CLIPS to obtain a character from input
func (*ErrorRouter) LastMessage ¶
func (r *ErrorRouter) LastMessage() string
LastMessage returns the accumulated error message and resets it
func (*ErrorRouter) Print ¶
func (r *ErrorRouter) Print(name string, message string)
Print is called with a message if Query has returned true
func (*ErrorRouter) Query ¶
func (r *ErrorRouter) Query(name string) bool
Query should return true if the router handles the given logical IO name
type Fact ¶
type Fact interface { // Index returns the index number of this fact within CLIPS Index() int // Asserted returns true if the fact has been asserted. Asserted() bool // Assert asserts the fact Assert() error // Retract retracts the fact from CLIPS Retract() error // Template returns the template defining this fact Template() *Template // String returns a string representation of the fact String() string // Drop drops the reference to the fact in CLIPS. should be called when done with the fact Drop() // Equal returns true if this fact equal the given fact Equal(Fact) bool // Slots returns a *copy* of slot values for each slot in this fact Slots() (map[string]interface{}, error) // Slot returns the value of a given slot. For Implied Facts, "" is the only valid slot name Slot(slotname string) (interface{}, error) // ExtractSlot unmarshals the given slot into the user provided object ExtractSlot(retval interface{}, slotname string) error // Extract unmarshals the full fact into the user provided object Extract(retval interface{}) error }
Fact represents a fact within CLIPS
type Function ¶
type Function struct {
// contains filtered or unexported fields
}
Function references a CLIPS function
func (*Function) Call ¶
Call calls the CLIPS function with the given arguments (must be a space-delimited string)
func (*Function) Equal ¶
Equal returns true if the other function represents the same CLIPS function as this one
type Generic ¶
type Generic struct {
// contains filtered or unexported fields
}
Generic represents a CLIPS genneric
func (*Generic) Deletable ¶
Deletable returns true if the generic is unreferenced and can be deleted
type Global ¶
type Global struct {
// contains filtered or unexported fields
}
Global represents a global variable within CLIPS
type HighlightedWriter ¶
type HighlightedWriter struct {
// contains filtered or unexported fields
}
HighlightedWriter tries to catch selected writes and use the syntax highlighting on them
func (*HighlightedWriter) AskForCPR ¶
func (hw *HighlightedWriter) AskForCPR()
AskForCPR asks for a cursor position report (CPR).
func (*HighlightedWriter) ClearTitle ¶
func (hw *HighlightedWriter) ClearTitle()
ClearTitle clears a title of terminal window.
func (*HighlightedWriter) CursorBackward ¶
func (hw *HighlightedWriter) CursorBackward(n int)
CursorBackward moves the cursor backward by 'n' columns; the default count is 1.
func (*HighlightedWriter) CursorDown ¶
func (hw *HighlightedWriter) CursorDown(n int)
CursorDown moves the cursor down by 'n' rows; the default count is 1.
func (*HighlightedWriter) CursorForward ¶
func (hw *HighlightedWriter) CursorForward(n int)
CursorForward moves the cursor forward by 'n' columns; the default count is 1.
func (*HighlightedWriter) CursorGoTo ¶
func (hw *HighlightedWriter) CursorGoTo(row, col int)
CursorGoTo sets the cursor position where subsequent text will begin.
func (*HighlightedWriter) CursorUp ¶
func (hw *HighlightedWriter) CursorUp(n int)
CursorUp moves the cursor up by 'n' rows; the default count is 1.
func (*HighlightedWriter) EraseDown ¶
func (hw *HighlightedWriter) EraseDown()
EraseDown erases the screen from the current line down to the bottom of the screen.
func (*HighlightedWriter) EraseEndOfLine ¶
func (hw *HighlightedWriter) EraseEndOfLine()
EraseEndOfLine erases from the current cursor position to the end of the current line.
func (*HighlightedWriter) EraseLine ¶
func (hw *HighlightedWriter) EraseLine()
EraseLine erases the entire current line.
func (*HighlightedWriter) EraseScreen ¶
func (hw *HighlightedWriter) EraseScreen()
EraseScreen erases the screen with the background colour and moves the cursor to home.
func (*HighlightedWriter) EraseStartOfLine ¶
func (hw *HighlightedWriter) EraseStartOfLine()
EraseStartOfLine erases from the current cursor position to the start of the current line.
func (*HighlightedWriter) EraseUp ¶
func (hw *HighlightedWriter) EraseUp()
EraseUp erases the screen from the current line up to the top of the screen.
func (*HighlightedWriter) HideCursor ¶
func (hw *HighlightedWriter) HideCursor()
HideCursor hides cursor.
func (*HighlightedWriter) SaveCursor ¶
func (hw *HighlightedWriter) SaveCursor()
SaveCursor saves current cursor position.
func (*HighlightedWriter) ScrollDown ¶
func (hw *HighlightedWriter) ScrollDown()
ScrollDown scrolls display down one line.
func (*HighlightedWriter) ScrollUp ¶
func (hw *HighlightedWriter) ScrollUp()
ScrollUp scroll display up one line.
func (*HighlightedWriter) SetColor ¶
func (hw *HighlightedWriter) SetColor(fg, bg prompt.Color, bold bool)
SetColor sets text and background colors. and specify whether text is bold.
func (*HighlightedWriter) SetTitle ¶
func (hw *HighlightedWriter) SetTitle(title string)
SetTitle sets a title of terminal window.
func (*HighlightedWriter) ShowCursor ¶
func (hw *HighlightedWriter) ShowCursor()
ShowCursor stops blinking cursor and show.
func (*HighlightedWriter) UnSaveCursor ¶
func (hw *HighlightedWriter) UnSaveCursor()
UnSaveCursor restores cursor position after a Save Cursor.
func (*HighlightedWriter) Write ¶
func (hw *HighlightedWriter) Write(data []byte)
Write to write safety byte array by removing control sequences.
func (*HighlightedWriter) WriteRaw ¶
func (hw *HighlightedWriter) WriteRaw(data []byte)
WriteRaw to write raw byte array.
func (*HighlightedWriter) WriteRawStr ¶
func (hw *HighlightedWriter) WriteRawStr(data string)
WriteRawStr to write raw string.
func (*HighlightedWriter) WriteStr ¶
func (hw *HighlightedWriter) WriteStr(data string)
WriteStr to write safety string by removing control sequences.
type ImpliedFact ¶
type ImpliedFact struct {
// contains filtered or unexported fields
}
ImpliedFact is an ordered fact having an implied definition
func (*ImpliedFact) Append ¶
func (f *ImpliedFact) Append(value interface{}) error
Append an element to the fact
func (*ImpliedFact) Asserted ¶
func (f *ImpliedFact) Asserted() bool
Asserted returns true if the fact has been asserted.
func (*ImpliedFact) Drop ¶
func (f *ImpliedFact) Drop()
Drop drops the reference to the fact in CLIPS. should be called when done with the fact
func (*ImpliedFact) Equal ¶
func (f *ImpliedFact) Equal(otherfact Fact) bool
Equal returns true if this fact equal the given fact
func (*ImpliedFact) Extend ¶
func (f *ImpliedFact) Extend(values []interface{}) error
Extend Appends the contents of a slice to the fact
func (*ImpliedFact) Extract ¶
func (f *ImpliedFact) Extract(retval interface{}) error
Extract unmarshals this fact into the user provided object
func (*ImpliedFact) ExtractSlot ¶
func (f *ImpliedFact) ExtractSlot(retval interface{}, slotname string) error
ExtractSlot unmarshals the value of the given slot into the user provided object. For Implied Facts, the only valid slot name is ""
func (*ImpliedFact) Index ¶
func (f *ImpliedFact) Index() int
Index returns the index number of this fact within CLIPS
func (*ImpliedFact) Retract ¶
func (f *ImpliedFact) Retract() error
Retract retracts the fact from CLIPS
func (*ImpliedFact) Set ¶
func (f *ImpliedFact) Set(index int, value interface{}) error
Set alters the item at a specific in the multifield
func (*ImpliedFact) Slot ¶
func (f *ImpliedFact) Slot(slotname string) (interface{}, error)
Slot returns the value of the given slot. For Implied Facts, the only valid slot name is ""
func (*ImpliedFact) Slots ¶
func (f *ImpliedFact) Slots() (map[string]interface{}, error)
Slots returns a function that can be called to get the next slot for this fact. Will return nil when no more slots remain
func (*ImpliedFact) String ¶
func (f *ImpliedFact) String() string
String returns a string representation of the fact
func (*ImpliedFact) Template ¶
func (f *ImpliedFact) Template() *Template
Template returns the template defining this fact
type ImpliedFactSlot ¶
type ImpliedFactSlot struct {
// contains filtered or unexported fields
}
ImpliedFactSlot is a hook to the value of a particular slot
type InsertClassOption ¶
type InsertClassOption string
InsertClassOption tweaks how the inserted class is instructed
const ( // DoNotRestrictAllowedClasses prevents the class insertion from using an allowed-class constraint for instance-name slots. Primarily useful if [nil] must be allowed DoNotRestrictAllowedClasses InsertClassOption = "DoNotRestrictAllowedClasses" )
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance represents an instance of a class from CLIPS
func (*Instance) Drop ¶
func (inst *Instance) Drop()
Drop drops the reference to the instance in CLIPS. should be called when done with the instance
func (*Instance) Equal ¶
Equal returns true if the other instance represents the same CLIPS inst as this one
func (*Instance) Extract ¶
Extract attempts to marshall the CLIPS instance data into the user-provided or pointer The return value can be a struct or a map of string to another datatype. If retval points to a valid object, that object will be populated. If it is not, one will be created
func (*Instance) ExtractSlot ¶
ExtractSlot obtains the given slot value into the user-provided object
func (*Instance) Name ¶
func (inst *Instance) Name() InstanceName
Name returns the name of this instance
func (*Instance) Send ¶
Send sends a message tot his instance. Message arguments must be provided as a string
func (*Instance) SetSlot ¶
SetSlot sets the slot to the given value. Warning, this function bypasses message-passing
func (*Instance) Slot ¶
Slot returns the value of the given slot. Warning, this function bypasses message-passing
type LoggingRouter ¶
type LoggingRouter struct {
// contains filtered or unexported fields
}
LoggingRouter is a router that puts messages into go logging
func CreateLoggingRouter ¶
func CreateLoggingRouter(env *Environment, logger *log.Logger) *LoggingRouter
CreateLoggingRouter returns a new logging router
func (*LoggingRouter) Activate ¶
func (r *LoggingRouter) Activate() error
Activate activates this router with the Env
func (*LoggingRouter) Deactivate ¶
func (r *LoggingRouter) Deactivate() error
Deactivate deactivates this router with the Env
func (*LoggingRouter) Delete ¶
func (r *LoggingRouter) Delete() error
Delete removes this router from the Env
func (*LoggingRouter) Exit ¶
func (r *LoggingRouter) Exit(exitcode int)
Exit is called by CLIPS before CLIPS itself exits
func (*LoggingRouter) Getc ¶
func (r *LoggingRouter) Getc(name string) byte
Getc is called by CLIPS to obtain a character from input
func (*LoggingRouter) Print ¶
func (r *LoggingRouter) Print(name string, message string)
Print is called with a message if Query has returned true
func (*LoggingRouter) Query ¶
func (r *LoggingRouter) Query(name string) bool
Query should return true if the router handles the given logical IO name
type MessageHandler ¶
type MessageHandler struct {
// contains filtered or unexported fields
}
MessageHandler is a reference to a messagehandler for a particular class
func (*MessageHandler) Deletable ¶
func (mh *MessageHandler) Deletable() bool
Deletable returns true if this messagehandler can be deleted
func (*MessageHandler) Equal ¶
func (mh *MessageHandler) Equal(other *MessageHandler) bool
Equal returns true if this messagehandler represents the same CLIPS handler as the other one
func (*MessageHandler) Name ¶
func (mh *MessageHandler) Name() string
Name returns the name of this message handler
func (*MessageHandler) String ¶
func (mh *MessageHandler) String() string
func (*MessageHandler) Type ¶
func (mh *MessageHandler) Type() MessageHandlerType
Type returns the messagehandler type
func (*MessageHandler) Undefine ¶
func (mh *MessageHandler) Undefine() error
Undefine undefines the message handler. Equivalent to undefmessage-handler
func (*MessageHandler) Watch ¶
func (mh *MessageHandler) Watch(val bool)
Watch sets whether this messagehandler should be watched
func (*MessageHandler) Watched ¶
func (mh *MessageHandler) Watched() bool
Watched returns true if this messagehandler is being watched
type MessageHandlerType ¶
type MessageHandlerType Symbol
const ( AROUND MessageHandlerType = "around" BEFORE MessageHandlerType = "before" PRIMARY MessageHandlerType = "primary" AFTER MessageHandlerType = "after" )
type Method ¶
type Method struct {
// contains filtered or unexported fields
}
Method represents one method of a CLIPS generic
func (*Method) Description ¶
Description returns the description of this method
func (*Method) Restrictions ¶
func (m *Method) Restrictions() interface{}
Restrictions returns the method restrictions for this method
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module represents a CLIPS module
type NotFoundError ¶
type NotFoundError error
NotFoundError is returned when an item does not exist in CLIPS
type Router ¶
type Router interface { // Name returns a name for this router Name() string // Query should return true if the router handles the given logical IO name Query(name string) bool // Print is called with a message if Query has returned true Print(name string, message string) // Getc is called by CLIPS to obtain a character from input Getc(name string) byte // Ungetc is called by CLIPS to push a character back into the input queue Ungetc(name string, ch byte) error // Exit is called by CLIPS before CLIPS itself exits Exit(exitcode int) // Activate activates this router with the Env Activate() error // Deactivate deactivates this router with the Env Deactivate() error // Delete removes this router from the Env Delete() error }
Router defines an object responsible for handling IO with CLIPS
type RouterCore ¶
type RouterCore struct {
// contains filtered or unexported fields
}
RouterCore is an implementation of common Router guts which can be used inside other Router implementations
func CreateRouterCore ¶
func CreateRouterCore(env *Environment, routerimpl Router, name string, handled []string, priority int) *RouterCore
CreateRouterCore creates an instance of the RouterCore which can be used to easily create a full Router
func (*RouterCore) Activate ¶
func (r *RouterCore) Activate() error
Activate activates the router in the Environment
func (*RouterCore) Deactivate ¶
func (r *RouterCore) Deactivate() error
Deactivate deactives the router in the environment
func (*RouterCore) Delete ¶
func (r *RouterCore) Delete() error
Delete deletes the router from the environment
func (*RouterCore) Print ¶
func (r *RouterCore) Print(name string, message string)
Print outputs message
func (*RouterCore) Query ¶
func (r *RouterCore) Query(name string) bool
Query returns true for handled logical io types
type Rule ¶
type Rule struct {
// contains filtered or unexported fields
}
Rule represents a rule within CLIPS
func (*Rule) AddBreakpoint ¶
func (r *Rule) AddBreakpoint()
AddBreakpoint adds a breakpoint for the rule
func (*Rule) Equal ¶
Equal returns true if the other rule represents the same CLIPS rule as this one
func (*Rule) Matches ¶
Matches shows partial matches and activations for the rule. Returns a list containing the combined sum of the matches, the combined sum of partial matches, then the total activations. Verbosity determines how much to output to stdout
func (*Rule) RemoveBreakpoint ¶
RemoveBreakpoint removes a breakpoint for the rule
func (*Rule) WatchActivations ¶
WatchActivations sets whether rule activations should be watched
func (*Rule) WatchFirings ¶
WatchFirings sets whether rule firigns are watched
func (*Rule) WatchedActivations ¶
WatchedActivations returns true if rule activations are being watched
func (*Rule) WatchedFirings ¶
WatchedFirings returns true if rule firings are being watched
type SalienceEvaluation ¶
type SalienceEvaluation int
SalienceEvaluation is used to specify the salience evaluation behavior
const ( WHEN_DEFINED SalienceEvaluation = iota WHEN_ACTIVATED EVERY_CYCLE )
func (SalienceEvaluation) CVal ¶
func (sm SalienceEvaluation) CVal() C.int
CVal returns the value as appropriate for a C call
func (SalienceEvaluation) String ¶
func (sm SalienceEvaluation) String() string
type SaveMode ¶
SaveMode is used to specify the type of save when saving objects to a file
type ShellContext ¶
type ShellContext struct {
// contains filtered or unexported fields
}
ShellContext stores the context of the shell environment
type Strategy ¶
type Strategy int
Strategy is used to specify the conflict resolution strategy
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
Template is a formal representation of the fact data structure, defined by deftemplate in CLIPS
func (*Template) Equal ¶
Equal returns true if this template represents the same template as the given one
func (*Template) Module ¶
Module returns the module in which the template is defined. Equivalent to (deftempalte-module)
func (*Template) Slots ¶
func (t *Template) Slots() map[string]*TemplateSlot
Slots returns the slot definitions contained in this template
func (*Template) Undefine ¶
Undefine the template. Equivalent to (undeftemplate). This object is unusable after this call
type TemplateFact ¶
type TemplateFact struct {
// contains filtered or unexported fields
}
TemplateFact is an unordered fact
func (*TemplateFact) Asserted ¶
func (f *TemplateFact) Asserted() bool
Asserted returns true if the fact has been asserted.
func (*TemplateFact) Drop ¶
func (f *TemplateFact) Drop()
Drop drops the reference to the fact in CLIPS. should be called when done with the fact
func (*TemplateFact) Equal ¶
func (f *TemplateFact) Equal(otherfact Fact) bool
Equal returns true if this fact equal the given fact
func (*TemplateFact) Extract ¶
func (f *TemplateFact) Extract(retval interface{}) error
Extract unmarshals this fact into the user provided object
func (*TemplateFact) ExtractSlot ¶
func (f *TemplateFact) ExtractSlot(retval interface{}, name string) error
ExtractSlot unmarshals the given slot value into the object provided by the user
func (*TemplateFact) Index ¶
func (f *TemplateFact) Index() int
Index returns the index number of this fact within CLIPS
func (*TemplateFact) Retract ¶
func (f *TemplateFact) Retract() error
Retract retracts the fact from CLIPS
func (*TemplateFact) Set ¶
func (f *TemplateFact) Set(slot string, value interface{}) error
Set alters the item at a specific in the multifield
func (*TemplateFact) Slot ¶
func (f *TemplateFact) Slot(name string) (interface{}, error)
Slot returns the value stored in the given slot
func (*TemplateFact) Slots ¶
func (f *TemplateFact) Slots() (map[string]interface{}, error)
Slots returns a function that can be called to get the next slot for this fact. Will return nil when no more slots remain
func (*TemplateFact) String ¶
func (f *TemplateFact) String() string
String returns a string representation of the fact
func (*TemplateFact) Template ¶
func (f *TemplateFact) Template() *Template
Template returns the template defining this fact
type TemplateSlot ¶
type TemplateSlot struct {
// contains filtered or unexported fields
}
TemplateSlot defines one slot within a template
func (*TemplateSlot) AllowedValues ¶
func (ts *TemplateSlot) AllowedValues() (values []interface{}, ok bool)
AllowedValues returns the set of allowed values for this slot, if specified
func (*TemplateSlot) Cardinality ¶
func (ts *TemplateSlot) Cardinality() (low int64, high int64, hasHigh bool)
Cardinality returns the cardinality for the slot
func (*TemplateSlot) DefaultType ¶
func (ts *TemplateSlot) DefaultType() TemplateSlotDefaultType
DefaultType returns the type of default value for this slot
func (*TemplateSlot) DefaultValue ¶
func (ts *TemplateSlot) DefaultValue() interface{}
DefaultValue returns a default value for the slot. (This might be a new, unique value for DYNAMIC_DEFAULT defaults)
func (*TemplateSlot) Equal ¶
func (ts *TemplateSlot) Equal(other *TemplateSlot) bool
Equal checks if the other templateslot represents the same slot
func (*TemplateSlot) FloatRange ¶
func (ts *TemplateSlot) FloatRange() (low float64, hasLow bool, high float64, hasHigh bool)
FloatRange returns the numeric range for the slot for floating point values - e.g. low, haslow, high, hashigh := ts.Range()
func (*TemplateSlot) IntRange ¶
func (ts *TemplateSlot) IntRange() (low int64, hasLow bool, high int64, hasHigh bool)
IntRange returns the numeric range for the slot for integer values - e.g. low, haslow, high, hashigh := ts.Range()
func (*TemplateSlot) Multifield ¶
func (ts *TemplateSlot) Multifield() bool
Multifield returns true if the slot is a multifield slot
func (*TemplateSlot) Name ¶
func (ts *TemplateSlot) Name() string
Name returns the name of this slot
func (*TemplateSlot) String ¶
func (ts *TemplateSlot) String() string
func (*TemplateSlot) Types ¶
func (ts *TemplateSlot) Types() []Symbol
Types returns the set of value types for this slot
type TemplateSlotDefaultType ¶
type TemplateSlotDefaultType int
TemplateSlotDefaultType is used to specify how default is specifified for a slot within a template
const ( NO_DEFAULT TemplateSlotDefaultType = iota STATIC_DEFAULT DYNAMIC_DEFAULT )
func (TemplateSlotDefaultType) CVal ¶
func (tsdt TemplateSlotDefaultType) CVal() C.int
CVal returns the value as appropriate for a C call
func (TemplateSlotDefaultType) String ¶
func (tsdt TemplateSlotDefaultType) String() string