To define a new cp class, you just have to provide an implementation for the wrappers between your type foo and the type Raw.cp.

Once you have your wrappers w, write

class foo_cp = [foo] cp_custom_type w

For further details, have a look at the commented .ml file, section Predefined cp classes.

Accessing methods

method get : 'a
method set : 'a -> unit
method get_default : 'a
method get_help : string
method get_name : string list
method reset : unit

Resets to the default value.


method add_hook : ('a -> 'a -> unit) -> unit

All the hooks are executed each time the method set is called, just after setting the new value.

method set_short_name : string -> unit

Used to generate command line arguments in

method get_short_name : string option

None if no optional short_name was provided during object creation and set_short_name was never called.

Methods for internal use

method get_formatted : Format.formatter -> unit
method get_default_formatted : Format.formatter -> unit
method get_help_formatted : Format.formatter -> unit
method get_spec : Arg.spec
method set_raw : Raw.cp -> unit