1/****************************************************************************************
2
3 Copyright (C) 2015 Autodesk, Inc.
4 All rights reserved.
5
6 Use of this software is subject to the terms of the Autodesk license agreement
7 provided at the time of installation or download, or which otherwise accompanies
8 this software in either electronic or hard copy form.
9
10****************************************************************************************/
11
12//! \file fbxatomic.h
13#ifndef _FBXSDK_CORE_SYNC_ATOMIC_H_
14#define _FBXSDK_CORE_SYNC_ATOMIC_H_
15
16#include <fbxsdk/fbxsdk_def.h>
17
18#if !defined(FBXSDK_ENV_WINSTORE) && !defined(FBXSDK_ENV_EMSCRIPTEN)
19
20#include <fbxsdk/fbxsdk_nsbegin.h>
21
22class FBXSDK_DLL FbxAtomOp
23{
24public:
25 static void Inc(volatile FbxAtomic* pPtr);
26 static void Dec(volatile FbxAtomic* pPtr);
27 static bool Add(volatile FbxAtomic* pPtr, FbxAtomic pVal);
28 static bool Sub(volatile FbxAtomic* pPtr, FbxAtomic pVal);
29 static bool And(volatile FbxAtomic* pPtr, FbxAtomic pVal);
30 static bool Or(volatile FbxAtomic* pPtr, FbxAtomic pVal);
31 static bool Nand(volatile FbxAtomic* pPtr, FbxAtomic pVal);
32 static bool Xor(volatile FbxAtomic* pPtr, FbxAtomic pVal);
33 static bool CompareAndSwap(volatile FbxAtomic* pPtr, FbxAtomic pOld, FbxAtomic pSwap);
34 static FbxAtomic TestAndSet(volatile FbxAtomic* pPtr);
35 static FbxAtomic FetchAndSwap(volatile FbxAtomic* pPtr, FbxAtomic pSwap);
36 static FbxAtomic FetchAndInc(volatile FbxAtomic* pPtr);
37 static FbxAtomic FetchAndDec(volatile FbxAtomic* pPtr);
38 static FbxAtomic FetchAndAdd(volatile FbxAtomic* pPtr, FbxAtomic pVal);
39 static FbxAtomic FetchAndSub(volatile FbxAtomic* pPtr, FbxAtomic pVal);
40 static FbxAtomic FetchAndOr(volatile FbxAtomic* pPtr, FbxAtomic pVal);
41 static FbxAtomic FetchAndAnd(volatile FbxAtomic* pPtr, FbxAtomic pVal);
42 static FbxAtomic FetchAndXor(volatile FbxAtomic* pPtr, FbxAtomic pVal);
43 static FbxAtomic FetchAndNand(volatile FbxAtomic* pPtr, FbxAtomic pVal);
44 static FbxAtomic IncAndFetch(volatile FbxAtomic* pPtr);
45 static FbxAtomic DecAndFetch(volatile FbxAtomic* pPtr);
46 static FbxAtomic AddAndFetch(volatile FbxAtomic* pPtr, FbxAtomic pVal);
47 static FbxAtomic SubAndFetch(volatile FbxAtomic* pPtr, FbxAtomic pVal);
48 static FbxAtomic OrAndFetch(volatile FbxAtomic* pPtr, FbxAtomic pVal);
49 static FbxAtomic AndAndFetch(volatile FbxAtomic* pPtr, FbxAtomic pVal);
50 static FbxAtomic XorAndFetch(volatile FbxAtomic* pPtr, FbxAtomic pVal);
51 static FbxAtomic NandAndFetch(volatile FbxAtomic* pPtr, FbxAtomic pVal);
52};
53
54#include <fbxsdk/fbxsdk_nsend.h>
55
56#endif /* !FBXSDK_ENV_WINSTORE && !FBXSDK_ENV_EMSCRIPTEN */
57
58#endif /* _FBXSDK_CORE_SYNC_ATOMIC_H_ */
59