Guid2.h

// Guid2.h
//
// Author David Barrett-Lennard
// (C)opyright Cedanet Pty Ltd 2009

#include "Ceda/cxUtils/Guid.h"
@import "IObject.h"

namespace ceda
{
///////////////////////////////////////////////////////////////////////////////////////////////////
// Guid

/*
todo. This is inadequate

-   Guid doesn't initialise to a null guid in the constructor

-   This doesn't give us the type ops, so Guid can't be used in an xmap.
*/
$struct+ Guid <<ser extern>>
{
    $uint32 Data1;
    $uint16 Data2;
    $uint16 Data3;
    $uint8  Data4[8];
};

$function+ inline xstring StringFromGuid(const Guid& g)
{
    return ceda::GuidToString(g);
}

$function+ inline Guid GuidFromString(ConstStringZ s)
{
    return ceda::StringToGuid(s);
}

///////////////////////////////////////////////////////////////////////////////////////////////////
// MGuid

$model+ MGuid
{
    assignable<Guid> Value;

    $$() : Value(Guid_NULL) {}
};

}