True Axis Physics SDK 1.2.0.1 Beta Documentation
www.trueaxis.com

Flags.h

00001 //---------------------------------------------------------------------------------
00002 // File Name: Flags.h
00003 // Description: General functions for flag manipulation
00004 //
00005 // Copyright (C) 2004 - 2006 True Axis Pty Ltd, Australia. 
00006 // All Rights Reserved.
00007 //
00008 // History:
00009 //      Created File.
00010 //---------------------------------------------------------------------------------
00011 
00012 #ifndef TA_FLAGS_H
00013 #define TA_FLAGS_H
00014 
00015 #ifndef TA_COMMON_H
00016 #include "Common.h"
00017 #endif // TA_COMMON_H
00018 
00019 namespace TA
00020 {
00021     
00022 template <class Type>
00023 inline void SetFlag(Type& m_nFlags, u32 nBit, bool bValue)
00024 {
00025     if (bValue)
00026         m_nFlags |= (Type)(nBit);
00027     else
00028         m_nFlags &= (Type)(~nBit);      
00029 }
00030 
00031 template <class Type>
00032 inline bool GetFlag(Type m_nFlags, u32 nBit)
00033 {
00034     return (m_nFlags & (Type)(nBit)) != 0;
00035 }
00036 
00037 }
00038 
00039 #endif // TA_FLAGS_H


© Copyright 2004-2006 TRUE AXIS PTY LTD Australia. All rights reserved.