#if !defined(__alffusesecurity_h) // Sentry, use file only if it's not already included.
#define __alffusesecurity_h
/*  Project Biblio-Tec

	 SUBSYSTEM:    TECSecurity.dll Library
	 FILE:         alffusesecurity.h
	 AUTHOR:       Alcindo Ferreira Filho

	 OVERVIEW:
	 Source file for definition of ALFFSecurityException and
    ALFFUseSecurity classes.
	 Class for managing security exceptions, initialization and
    multithread use.
    Based on OpenSSL (www.openssl.org).

    COPYRIGHT:    © 2003,2005
                  Alcindo Ferreira Filho
                  <alcindo@inttec.com.br>

    LICENSE:      Biblio-Tec license (BiblTec.txt)
*/

#include "alffexpt.h"
#include "alffobj.h"

#include "teclibs.h"

class _TECSECCLASS ALFFSecurityException : public ALFFException
{
  public:
  		ALFFSecurityException();
      ~ALFFSecurityException();
      char far* GetClassName() {return "ALFFSecurityException";}
};

///////////////////////////////////////////////////////////////////////////////
// ALFFUseSecurity
///////////////////////////////////////////////////////////////////////////////

class _TECSECCLASS ALFFUseSecurity : public ALFFObject
{
   public :

      ALFFUseSecurity(bool secOn, bool multiThreadedUse);
      ~ALFFUseSecurity();
      char far* 	GetClassName() { return "ALFFUseSecurity"; }
      void  		AddCall(ALFFObject* alffObj);
      void  		InitLibraries();
      ULONG 		GetNumberOfCalls() { return numberOfCalls; }
      bool  		IsSecurityOn() { return securityOn; }
      
   private:
      ULONG 		numberOfCalls;
      const	bool 	m_weOwnLocks;
      bool  		securityOn;

      // No copies do not implement
      ALFFUseSecurity(const ALFFUseSecurity &rhs);
      ALFFUseSecurity &operator=(const ALFFUseSecurity &rhs);
};

///////////////////////////////////////////////////////////////////////////////
// End of file
///////////////////////////////////////////////////////////////////////////////
#endif
