Adobe.com
Contents Suites Classes Class Index Member Index

IAIUUID.h

Go to the documentation of this file.
00001 /*************************************************************************
00002 *
00003 * ADOBE CONFIDENTIAL
00004 * 
00005 * Copyright 2017 Adobe
00006 * 
00007 * All Rights Reserved.
00008 *
00009 * NOTICE: Adobe permits you to use, modify, and distribute this file in
00010 * accordance with the terms of the Adobe license agreement accompanying
00011 * it. If you have received this file from a source other than Adobe,
00012 * then your use, modification, or distribution of it requires the prior
00013 * written permission of Adobe.
00014 *
00015 **************************************************************************/
00016 
00017 #pragma once
00018 
00019 #include "AIBasicTypes.h"
00020 
00021 #include "AIHeaderBegin.h"
00022 
00023 namespace ai
00024 {
00025         constexpr size_t kUUID_SIZE = 16;
00026         
00032         class uuid
00033         {
00034         public:
00035                 uuid()
00036                 {}
00037 
00038                 uuid(const ai::uint8 data[kUUID_SIZE])
00039                 {
00040                         Set(data);
00041                 }
00042 
00043                 void Set(const ai::uint8 data[kUUID_SIZE])
00044                 {
00045                         memcpy(mData, data, kUUID_SIZE);
00046                 }
00047 
00048                 bool operator==(const uuid &rhs) const
00049                 {
00050                         return (0 == memcmp(mData, rhs.mData, kUUID_SIZE));
00051                 }
00052 
00053                 bool operator!=(const uuid &rhs) const
00054                 {
00055                         return (0 != memcmp(mData, rhs.mData, kUUID_SIZE));
00056                 }
00057         
00058                 bool operator<(const uuid &rhs) const
00059                 {
00060                         return (0 > memcmp(mData, rhs.mData, kUUID_SIZE));
00061                 }
00062                 
00063                 void Clear()
00064         {
00065             memset(mData, 0, kUUID_SIZE);
00066         }
00067                 
00068                 ai::uint8 mData[kUUID_SIZE] = { 0 };
00069         };
00070 }
00071 
00072 #include "AIHeaderEnd.h"


Contents Suites Classes Class Index Member Index
Adobe Solutions Network
 
Copyright © 2014 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks