| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
QuantLib.Context
Contents
Description
process-global evaluation context: run-time library settings and the exception type raised across the FFI boundary
Synopsis
- data Error
- data SettingsSnapshot = SettingsSnapshot {}
- restoreSettings :: SettingsSnapshot -> IO ()
- setEvaluationDate :: Maybe Day -> IO ()
- setEnforceTodaysHistoricFixings :: Bool -> IO ()
- setIncludeTodaysCashFlows :: Maybe Bool -> IO ()
- setIncludeReferenceDateEvents :: Bool -> IO ()
- disableUpdates :: Bool -> IO ()
- enableUpdates :: IO ()
- keepingSettings :: IO b -> IO b
- keepingSettingsGc :: IO b -> IO b
- collectGarbage :: IO ()
- setExtendedPrecision :: IO ()
- captureSettings :: IO SettingsSnapshot
- evaluationDate :: IO Day
- enforceTodaysHistoricFixings :: IO Bool
- includeTodaysCashFlows :: IO (Maybe Bool)
- includeReferenceDateEvents :: IO Bool
- updatesEnabled :: IO Bool
- updatesDeferred :: IO Bool
- version :: String
- boostVersion :: String
- epsilon :: Double
Types
Constructors
| CPlusPlusException String | |
| UnsupportedQuantLibVersion String String String | Call name, minimum required version, and linked QuantLib version. |
| DateConversion Day | |
| EnumConversion String | |
| CallbackResultLength Int Int | A Haskell callback returned an array of the wrong length: expected, then returned. |
Instances
| Exception Error Source # | |
Defined in QuantLib.Internal Methods toException :: Error -> SomeException # fromException :: SomeException -> Maybe Error # displayException :: Error -> String # backtraceDesired :: Error -> Bool # | |
| Show Error Source # | |
| Eq Error Source # | |
data SettingsSnapshot Source #
A value snapshot of pricing and observer settings. A Nothing date retains the
floating evaluation-date mode; it is not replaced with today's date.
Constructors
| SettingsSnapshot | |
Instances
| Show SettingsSnapshot Source # | |
Defined in QuantLib.Context Methods showsPrec :: Int -> SettingsSnapshot -> ShowS # show :: SettingsSnapshot -> String # showList :: [SettingsSnapshot] -> ShowS # | |
| Eq SettingsSnapshot Source # | |
Defined in QuantLib.Context Methods (==) :: SettingsSnapshot -> SettingsSnapshot -> Bool # (/=) :: SettingsSnapshot -> SettingsSnapshot -> Bool # | |
Mutators
restoreSettings :: SettingsSnapshot -> IO () Source #
Restores a snapshot and reports errors rather than suppressing them as the native SavedSettings destructor does. Every field is attempted even if an observer throws.
setEvaluationDate :: Maybe Day -> IO () Source #
sets the value of the Evaluation Date. Nothing sets the evaluation date to Date::todaysDate() and allow it to change at midnight. This comes at the price of losing some performance, since the evaluation date is re-evaluated each time it is read.
setEnforceTodaysHistoricFixings :: Bool -> IO () Source #
sets the value of the boolean which enforce the usage of historic fixings for today's date
setIncludeTodaysCashFlows :: Maybe Bool -> IO () Source #
sets whether CashFlows occurring on today's date should enter the NPV
setIncludeReferenceDateEvents :: Bool -> IO () Source #
sets whether Events occurring on the reference date should, by default, be taken into account as not happened yet
Disables observer notifications. When deferred is True, notifications are queued until
enableUpdates is called; otherwise they are discarded.
enableUpdates :: IO () Source #
Enables observer notifications and runs any notifications queued while updates were deferred.
keepingSettings :: IO b -> IO b Source #
brackets to restore settings once action has completed or raised an exception
keepingSettingsGc :: IO b -> IO b Source #
brackets to restore settings once action has completed or raised an exception. Before restoring settings
collectGarbage is run to avoid problems with market data objects watching evaluation date
collectGarbage :: IO () Source #
Best effort: give the finalizers of unreachable QuantLib objects a chance to run, so
their C++ destructors fire before, say, setEvaluationDate notifies surviving observers.
performGC only schedules finalizers, it does not run them synchronously, so this is a
nudge rather than a guarantee. Where correctness depends on an object being gone, anchor
its dates so staleness cannot arise in the first place.
setExtendedPrecision :: IO () Source #
Sets the x87 floating-point unit to 64-bit extended precision. On Windows, call on each OS thread before it prices, since the control word is per-thread; a no-op elsewhere.
Inspectors
captureSettings :: IO SettingsSnapshot Source #
Copies all settings preserved by keepingSettings, including the raw date mode.
evaluationDate :: IO Day Source #
returns the current value of the Evaluation Date: the date at which pricing is to be performed
enforceTodaysHistoricFixings :: IO Bool Source #
returns the current value of the boolean which enforce the usage of historic fixings for today's date
includeTodaysCashFlows :: IO (Maybe Bool) Source #
if set, whether CashFlows occurring on today's date should enter the NPV; when the NPV date equals today's date this overrides includeReferenceDateEvents and cannot be overridden locally
includeReferenceDateEvents :: IO Bool Source #
This flag specifies whether or not Events occurring on the reference date should, by default, be taken into account as not happened yet. It can be overridden locally when calling the Event::hasOccurred method.
updatesEnabled :: IO Bool Source #
Whether observer notifications are currently enabled.
updatesDeferred :: IO Bool Source #
Whether observer notifications are currently disabled with deferred delivery enabled.