CLEAN
Valuation library for mortgage-backed securities
setup.h
1 // -*-C++-*- make sure Emacs is in C++ mode
2 // ===========================================
3 // C++ API for the `AKA Clean Library`_
4 // ===========================================
5 // .. _`AKA Clean Library`: documentation.html
6 //
7 // :Version: 6.3.4
8 // :Date: 20210730
9 //
10 // Copyright (c) 2010, Andrew Kalotay Associates. All rights reserved.
11 // Consult your license for permissions and restrictions.
12 //
13 // andrew_kalotay_associates/clean/setup.h
14 // ------------------------------------------
15 // This document contains a formatted version of the C++ header file.
16 // The comments in the header file are marked up with `reStructuredText`_
17 // and converted to HTML using `Docutils`_.
18 // The C++ code from the header file appears below
19 // in a fixed width font over a blue background.
20 //
21 // .. _`reStructuredText`: http:// docutils.sourceforge.net/rst.html
22 // .. _`Docutils`: http:// docutils.sourceforge.net
23 //
24 
25 #ifndef INCLUDED_ANDREW_KALOTAY_ASSOCIATES_CLEAN_SETUP_H
26 #define INCLUDED_ANDREW_KALOTAY_ASSOCIATES_CLEAN_SETUP_H
27 
28 // Calling conventions
29 // --------------------
30 //
31 // + Input
32 //
33 // - Built-in types are passed by value
34 // - Structs are passed by reference
35 // - Arrays are passed using the class template Array
36 // - All dates are entered using the struct Date
37 // - Interest rates, volatilities, and reversion rates are entered
38 // as decimals. For example, an annual interest rate
39 // of 10% is entered as 0.10.
40 // - Prices are entered as a fraction of the principal remaining as of the
41 // valuation date. For example, a price of 100 should be entered as 1.00.
42 // - Caller is responsible for allocating memory for input structs
43 //
44 // + Output
45 //
46 // - All output is returned by value as built-in type or struct
47 // - Output arrays are returned using the class template Array
48 // - Prices are returned as a fraction of the principal remaining as of the
49 // valuation date. For example, a return value of 1.00 corresponds
50 // to a price of $100 per $100 of principal remaining as of the
51 // valuation date.
52 //
53 
54 #include "andrew_kalotay_associates/clean/dll_macros.h"
55 #include "andrew_kalotay_associates/clean/structs.h"
56 
57 namespace AndrewKalotayAssociates
58 {
59  namespace Clean
60  {
61  class CLEAN_API Setup
62  {
63  public:
64  //
65  // *This routine must be called first (and only once), before any other routine is called.*
66  //
67  static
68  bool
69  initialize(const char* userid,
70  const char* license);
71 
72  //
73  // *Is license valid and library initialized?*
74  //
75  static
76  bool is_authorized();
77 
78  //
79  // *Expiration date of license*
80  //
81  static
82  Date expiration();
83 
84  static
85  double version();
86 
87  static
88  const char* version_string();
89 
90  //
91  // *Number of buckets used (compile-time constant)*
92  //
93  static
94  long laggard_buckets_size();
95  };
96  }
97 }
98 
99 #endif
100 
101