Use a variable on the stack to not have a temporary in the call
[ACE_TAO.git] / ACE / protocols / ace / INet / AuthenticationBase.h
blobf6a638feec8878a13ba2247d7b52d0e193ecc4b8
1 /**
2 * @file AuthenticationBase.h
4 * @author Martin Corino <mcorino@remedy.nl>
5 */
7 #ifndef ACE_INET_AUTHENTICATION_BASE_H
8 #define ACE_INET_AUTHENTICATION_BASE_H
10 #include /**/ "ace/pre.h"
12 #include "ace/INet/INet_Export.h"
13 #include "ace/SString.h"
15 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
17 namespace ACE
19 namespace INet
21 /**
22 * @class ACE_INet_AuthenticationBase
24 * @brief Base class for authentication information
25 * holder.
28 class ACE_INET_Export AuthenticationBase
30 public:
31 /// Destructor
32 virtual ~AuthenticationBase ();
34 /// Returns authentication scheme (f.i. 'ftp' or 'http:basic').
35 virtual const ACE_CString& scheme () const = 0;
37 /// Returns authentication realm.
38 virtual const ACE_CString& realm () const = 0;
40 /// Returns user id.
41 virtual const ACE_CString& user () const = 0;
43 /// Changes user id.
44 virtual void user (const ACE_CString& usr) = 0;
46 /// Returns password.
47 virtual const ACE_CString& password () const = 0;
49 /// Changes password.
50 virtual void password (const ACE_CString& pw) = 0;
52 protected:
53 /// Constructor
54 AuthenticationBase ();
57 /**
58 * @class ACE_INet_AuthenticatorBase
60 * @brief Base class for authenticators.
63 class ACE_INET_Export AuthenticatorBase
65 public:
66 /// Default constructor
67 AuthenticatorBase ();
69 /// Destructor
70 virtual ~AuthenticatorBase ();
72 /// Verifies authentication for given info and returns true if
73 /// verification succeeded, false otherwise.
74 /// If true, the authentication information is updated with the actual
75 /// credentials.
76 virtual bool authenticate(AuthenticationBase& authentication) const = 0;
81 ACE_END_VERSIONED_NAMESPACE_DECL
83 #if defined (__ACE_INLINE__)
84 #include "ace/INet/AuthenticationBase.inl"
85 #endif
87 #include /**/ "ace/post.h"
88 #endif /* ACE_INET_AUTHENTICATION_BASE_H */