hasquant
Safe HaskellNone
LanguageHaskell2010

QuantLib.Context

Description

process-global evaluation context: run-time library settings and the exception type raised across the FFI boundary

Synopsis

Types

data Error Source #

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

Instances details
Exception Error Source # 
Instance details

Defined in QuantLib.Internal

Show Error Source # 
Instance details

Defined in QuantLib.Internal

Methods

showsPrec :: Int -> Error -> ShowS #

show :: Error -> String #

showList :: [Error] -> ShowS #

Eq Error Source # 
Instance details

Defined in QuantLib.Internal

Methods

(==) :: Error -> Error -> Bool #

(/=) :: Error -> Error -> Bool #

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.

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

disableUpdates Source #

Arguments

:: Bool

deferred

-> IO () 

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.