author | Michael Krelin <hacker@klever.net> | 2007-11-22 23:00:32 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-11-22 23:00:32 (UTC) |
commit | 2589c69c4a909563098365fba141082db4657353 (patch) (unidiff) | |
tree | e42018dd7d2ed1bbdee90155d3c99bbaf0011bc0 /include/opkele/consumer.h | |
parent | e6b62b080eae38a7c62be1148cf794085e9065c3 (diff) | |
download | libopkele-2589c69c4a909563098365fba141082db4657353.zip libopkele-2589c69c4a909563098365fba141082db4657353.tar.gz libopkele-2589c69c4a909563098365fba141082db4657353.tar.bz2 |
added virtual destructors to base classes
and bumped version to 0.4
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | include/opkele/consumer.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/opkele/consumer.h b/include/opkele/consumer.h index b9d1e54..50ff692 100644 --- a/include/opkele/consumer.h +++ b/include/opkele/consumer.h | |||
@@ -1,88 +1,90 @@ | |||
1 | #ifndef __OPKELE_CONSUMER_H | 1 | #ifndef __OPKELE_CONSUMER_H |
2 | #define __OPKELE_CONSUMER_H | 2 | #define __OPKELE_CONSUMER_H |
3 | 3 | ||
4 | #include <opkele/types.h> | 4 | #include <opkele/types.h> |
5 | #include <opkele/extension.h> | 5 | #include <opkele/extension.h> |
6 | 6 | ||
7 | /** | 7 | /** |
8 | * @file | 8 | * @file |
9 | * @brief OpenID consumer-side functionality | 9 | * @brief OpenID consumer-side functionality |
10 | */ | 10 | */ |
11 | 11 | ||
12 | namespace opkele { | 12 | namespace opkele { |
13 | 13 | ||
14 | /** | 14 | /** |
15 | * implementation of basic consumer functionality | 15 | * implementation of basic consumer functionality |
16 | * | 16 | * |
17 | * @note | 17 | * @note |
18 | * The consumer uses libcurl internally, which means that if you're using | 18 | * The consumer uses libcurl internally, which means that if you're using |
19 | * libopkele in multithreaded environment you should call curl_global_init | 19 | * libopkele in multithreaded environment you should call curl_global_init |
20 | * yourself before spawning any threads. | 20 | * yourself before spawning any threads. |
21 | */ | 21 | */ |
22 | class consumer_t { | 22 | class consumer_t { |
23 | public: | 23 | public: |
24 | 24 | ||
25 | virtual ~consumer_t() { } | ||
26 | |||
25 | /** | 27 | /** |
26 | * store association. The function should be overridden in the real | 28 | * store association. The function should be overridden in the real |
27 | * implementation to provide persistent associations store. | 29 | * implementation to provide persistent associations store. |
28 | * @param server the OpenID server | 30 | * @param server the OpenID server |
29 | * @param handle association handle | 31 | * @param handle association handle |
30 | * @param secret the secret associated with the server and handle | 32 | * @param secret the secret associated with the server and handle |
31 | * @param expires_in the number of seconds until the handle is expired | 33 | * @param expires_in the number of seconds until the handle is expired |
32 | * @return the auto_ptr<> for the newly allocated association_t object | 34 | * @return the auto_ptr<> for the newly allocated association_t object |
33 | */ | 35 | */ |
34 | virtual assoc_t store_assoc(const string& server,const string& handle,const secret_t& secret,int expires_in) = 0; | 36 | virtual assoc_t store_assoc(const string& server,const string& handle,const secret_t& secret,int expires_in) = 0; |
35 | /** | 37 | /** |
36 | * retrieve stored association. The function should be overridden | 38 | * retrieve stored association. The function should be overridden |
37 | * in the real implementation to provide persistent assocations | 39 | * in the real implementation to provide persistent assocations |
38 | * store. | 40 | * store. |
39 | * | 41 | * |
40 | * @note | 42 | * @note |
41 | * The user is responsible for handling associations expiry and | 43 | * The user is responsible for handling associations expiry and |
42 | * this function should never return an expired or invalidated | 44 | * this function should never return an expired or invalidated |
43 | * association. | 45 | * association. |
44 | * | 46 | * |
45 | * @param server the OpenID server | 47 | * @param server the OpenID server |
46 | * @param handle association handle | 48 | * @param handle association handle |
47 | * @return the autho_ptr<> for the newly allocated association_t object | 49 | * @return the autho_ptr<> for the newly allocated association_t object |
48 | * @throw failed_lookup if no unexpired association found | 50 | * @throw failed_lookup if no unexpired association found |
49 | */ | 51 | */ |
50 | virtual assoc_t retrieve_assoc(const string& server,const string& handle) = 0; | 52 | virtual assoc_t retrieve_assoc(const string& server,const string& handle) = 0; |
51 | /** | 53 | /** |
52 | * invalidate stored association. The function should be overridden | 54 | * invalidate stored association. The function should be overridden |
53 | * in the real implementation of the consumer. | 55 | * in the real implementation of the consumer. |
54 | * @param server the OpenID server | 56 | * @param server the OpenID server |
55 | * @param handle association handle | 57 | * @param handle association handle |
56 | */ | 58 | */ |
57 | virtual void invalidate_assoc(const string& server,const string& handle) = 0; | 59 | virtual void invalidate_assoc(const string& server,const string& handle) = 0; |
58 | /** | 60 | /** |
59 | * retrieve any unexpired association for the server. If the | 61 | * retrieve any unexpired association for the server. If the |
60 | * function is not overridden in the real implementation, the new | 62 | * function is not overridden in the real implementation, the new |
61 | * association will be established for each request. | 63 | * association will be established for each request. |
62 | * | 64 | * |
63 | * @note | 65 | * @note |
64 | * The user is responsible for handling associations and this | 66 | * The user is responsible for handling associations and this |
65 | * function should never return an expired or invalidated | 67 | * function should never return an expired or invalidated |
66 | * association. | 68 | * association. |
67 | * | 69 | * |
68 | * @param server the OpenID server | 70 | * @param server the OpenID server |
69 | * @return the auto_ptr<> for the newly allocated association_t object | 71 | * @return the auto_ptr<> for the newly allocated association_t object |
70 | * @throw failed_lookup in case of absence of the handle | 72 | * @throw failed_lookup in case of absence of the handle |
71 | */ | 73 | */ |
72 | virtual assoc_t find_assoc(const string& server); | 74 | virtual assoc_t find_assoc(const string& server); |
73 | 75 | ||
74 | /** | 76 | /** |
75 | * retrieve the metainformation contained in link tags from the | 77 | * retrieve the metainformation contained in link tags from the |
76 | * page pointed by url. the function may implement caching of the | 78 | * page pointed by url. the function may implement caching of the |
77 | * information. | 79 | * information. |
78 | * @param url url to harvest for link tags | 80 | * @param url url to harvest for link tags |
79 | * @param server reference to the string object where to put | 81 | * @param server reference to the string object where to put |
80 | * openid.server value | 82 | * openid.server value |
81 | * @param delegate reference to the string object where to put the | 83 | * @param delegate reference to the string object where to put the |
82 | * openid.delegate value (if any) | 84 | * openid.delegate value (if any) |
83 | */ | 85 | */ |
84 | virtual void retrieve_links(const string& url,string& server,string& delegate); | 86 | virtual void retrieve_links(const string& url,string& server,string& delegate); |
85 | 87 | ||
86 | /** | 88 | /** |
87 | * perform the associate request to OpenID server. | 89 | * perform the associate request to OpenID server. |
88 | * @param server the OpenID server | 90 | * @param server the OpenID server |