summaryrefslogtreecommitdiffabout
path: root/include/opkele/association.h
Unidiff
Diffstat (limited to 'include/opkele/association.h') (more/less context) (ignore whitespace changes)
-rw-r--r--include/opkele/association.h21
1 files changed, 0 insertions, 21 deletions
diff --git a/include/opkele/association.h b/include/opkele/association.h
index ef0df42..a8f3915 100644
--- a/include/opkele/association.h
+++ b/include/opkele/association.h
@@ -1,89 +1,68 @@
1#ifndef __OPKELE_ASSOCIATION_H 1#ifndef __OPKELE_ASSOCIATION_H
2#define __OPKELE_ASSOCIATION_H 2#define __OPKELE_ASSOCIATION_H
3 3
4#include <time.h> 4#include <time.h>
5#include <opkele/types.h> 5#include <opkele/types.h>
6 6
7/** 7/**
8 * @file 8 * @file
9 * @brief reference implementation of association_t 9 * @brief reference implementation of association_t
10 */ 10 */
11 11
12/**
13 * @brief the main opkele namespace
14 */
15namespace opkele { 12namespace opkele {
16 13
17 /** 14 /**
18 * reference implementation of association_t class. 15 * reference implementation of association_t class.
19 */ 16 */
20 class association : public association_t { 17 class association : public association_t {
21 public: 18 public:
22 /** 19 /**
23 * OpenID server name 20 * OpenID server name
24 */ 21 */
25 string _server; 22 string _server;
26 /** 23 /**
27 * association handle 24 * association handle
28 */ 25 */
29 string _handle; 26 string _handle;
30 /** 27 /**
31 * association type 28 * association type
32 */ 29 */
33 string _assoc_type; 30 string _assoc_type;
34 /** 31 /**
35 * the secret 32 * the secret
36 */ 33 */
37 secret_t _secret; 34 secret_t _secret;
38 /** 35 /**
39 * expiration time 36 * expiration time
40 */ 37 */
41 time_t _expires; 38 time_t _expires;
42 /** 39 /**
43 * statelessness of the assoc_handle 40 * statelessness of the assoc_handle
44 */ 41 */
45 bool _stateless; 42 bool _stateless;
46 43
47 /** 44 /**
48 * @param __server the server name 45 * @param __server the server name
49 * @param __handle association handle 46 * @param __handle association handle
50 * @param __assoc_type association type 47 * @param __assoc_type association type
51 * @param __secret the secret 48 * @param __secret the secret
52 * @param __expires expiration time 49 * @param __expires expiration time
53 * @param __stateless statelessness of the assoc_handle 50 * @param __stateless statelessness of the assoc_handle
54 */ 51 */
55 association(const string& __server, const string& __handle, 52 association(const string& __server, const string& __handle,
56 const string& __assoc_type, const secret_t& __secret, 53 const string& __assoc_type, const secret_t& __secret,
57 time_t __expires, bool __stateless) 54 time_t __expires, bool __stateless)
58 : _server(__server), _handle(__handle), _assoc_type(__assoc_type), 55 : _server(__server), _handle(__handle), _assoc_type(__assoc_type),
59 _secret(__secret), _expires(__expires), _stateless(__stateless) { } 56 _secret(__secret), _expires(__expires), _stateless(__stateless) { }
60 57
61 /**
62 * @overload association_t::server()
63 */
64 virtual string server() const { return _server; } 58 virtual string server() const { return _server; }
65 /**
66 * @overload association_t::handle()
67 */
68 virtual string handle() const { return _handle; } 59 virtual string handle() const { return _handle; }
69 /**
70 * @overload association_t::assoc_type()
71 */
72 virtual string assoc_type() const { return _assoc_type; } 60 virtual string assoc_type() const { return _assoc_type; }
73 /**
74 * @overload association_t::secret()
75 */
76 virtual secret_t secret() const { return _secret; } 61 virtual secret_t secret() const { return _secret; }
77 /**
78 * @overload association_t::expires_in()
79 */
80 virtual int expires_in() const { return _expires-time(0); } 62 virtual int expires_in() const { return _expires-time(0); }
81 /**
82 * @overload association_t::stateless()
83 */
84 virtual bool stateless() const { return _stateless; } 63 virtual bool stateless() const { return _stateless; }
85 }; 64 };
86 65
87} 66}
88 67
89#endif /* __OPKELE_ASSOCIATION_H */ 68#endif /* __OPKELE_ASSOCIATION_H */