public/IAdminSystem.h
changeset 438 e6e11c82d87e
parent 434 db80fdcb09ce
child 458 77520125ee67
     1.1 --- a/public/IAdminSystem.h	Tue Feb 06 05:07:49 2007 +0000
     1.2 +++ b/public/IAdminSystem.h	Tue Feb 06 05:13:24 2007 +0000
     1.3 @@ -147,10 +147,6 @@
     1.4  	 */
     1.5  	typedef int		AdminId;
     1.6  
     1.7 -	#define ADMIN_CACHE_OVERRIDES	(1<<0)
     1.8 -	#define ADMIN_CACHE_ADMINS		(1<<1)
     1.9 -	#define ADMIN_CACHE_GROUPS		((1<<2)|ADMIN_CACHE_ADMINS)
    1.10 -
    1.11  	/**
    1.12  	 * @brief Represents an invalid/nonexistant group or an erroneous operation.
    1.13  	 */
    1.14 @@ -162,18 +158,42 @@
    1.15  	#define INVALID_ADMIN_ID	-1
    1.16  
    1.17  	/**
    1.18 +	 * @brief Represents the various cache regions.
    1.19 +	 */
    1.20 +	enum AdminCachePart
    1.21 +	{
    1.22 +		AdminCache_Overrides = 0,		/**< Global overrides */
    1.23 +		AdminCache_Groups = 1,			/**< All groups (automatically invalidates admins too) */
    1.24 +		AdminCache_Admins = 2,			/**< All admins */
    1.25 +	};
    1.26 +
    1.27 +	/**
    1.28  	 * @brief Provides callbacks for admin cache operations.
    1.29  	 */
    1.30  	class IAdminListener
    1.31  	{
    1.32  	public:
    1.33 +		virtual unsigned int GetInterfaceVersion()
    1.34 +		{
    1.35 +			return SMINTERFACE_ADMINSYS_VERSION;
    1.36 +		}
    1.37 +	public:
    1.38  		/**
    1.39 -		 * Called when part of the admin cache needs to be rebuilt.  
    1.40 -		 * Groups should always be rebuilt before admins.
    1.41 +		 * @brief Called when the admin cache needs to be rebuilt.  
    1.42  		 *
    1.43 -		 * @param cache_flags	Flags for which cache to dump.
    1.44 +		 * @param auto_rebuild		True if this is being called because of a group rebuild.
    1.45 +		 */
    1.46 +		virtual void OnRebuildAdminCache(bool auto_rebuild) =0;
    1.47 +
    1.48 +		/**
    1.49 +		 * @brief Called when the group cache needs to be rebuilt.
    1.50  		 */
    1.51 -		virtual void OnRebuildAdminCache(int cache_flags) =0;
    1.52 +		virtual void OnRebuildGroupCache() =0;
    1.53 +		
    1.54 +		/**
    1.55 +		 * @brief Called when the global override cache needs to be rebuilt.
    1.56 +		 */
    1.57 +		virtual void OnRebuildOverrideCache() =0;
    1.58  	};
    1.59  
    1.60  	typedef unsigned int FlagBits;
    1.61 @@ -339,10 +359,10 @@
    1.62  		 * @brief Tells the admin system to dump a portion of the cache.  
    1.63  		 * This calls into plugin forwards to rebuild the cache.
    1.64  		 *
    1.65 -		 * @param cache_flags	Flags for which cache to dump.  Specifying groups also dumps admins.
    1.66 +		 * @param part			Portion of the cache to dump.
    1.67  		 * @param rebuild		If true, the rebuild forwards/events will fire.
    1.68  		 */
    1.69 -		virtual void DumpAdminCache(int cache_flags, bool rebuild) =0;
    1.70 +		virtual void DumpAdminCache(AdminCachePart part, bool rebuild) =0;
    1.71  
    1.72  		/**
    1.73  		 * @brief Adds an admin interface listener.