Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#ifndef PTestJSON_h
#define PTestJSON_h
#include "mozilla/Attributes.h"
#include "IPCMessageStart.h"
#include "mozilla/RefPtr.h"
#include "nsString.h"
#include "nsTArray.h"
#include "nsTHashtable.h"
#include "mozilla/MozPromise.h"
#include "mozilla/OperatorNewExtensions.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/ipc/ByteBuf.h"
#include "mozilla/ipc/FileDescriptor.h"
#include "mozilla/ipc/IPCForwards.h"
#include "mozilla/ipc/Shmem.h"
// Headers for typedefs
#include "mozilla/ipc/IPCCore.h"
#include "mozilla/ipc/IPDLStructMember.h"
#include "mozilla/ipc/SideVariant.h"
namespace mozilla {
namespace _ipdltest {
class PTestJSONHandleParent;
} // namespace _ipdltest
} // namespace mozilla
namespace mozilla {
namespace _ipdltest {
class PTestJSONHandleChild;
} // namespace _ipdltest
} // namespace mozilla
namespace mozilla {
namespace _ipdltest {
class KeyValue;
} // namespace _ipdltest
} // namespace mozilla
//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union JSONVariant|
//
namespace mozilla {
namespace _ipdltest {
class JSONVariant final
{
public:
enum Type {
T__None,
Tvoid_t = 1,
Tnull_t,
Tbool,
Tint,
Tdouble,
TnsString,
TPTestJSONHandle,
TArrayOfKeyValue,
TArrayOfJSONVariant,
T__Last = TArrayOfJSONVariant
};
private:
typedef ::mozilla::void_t void_t;
typedef ::mozilla::null_t null_t;
typedef ::nsString nsString;
typedef ::mozilla::_ipdltest::PTestJSONHandleParent PTestJSONHandleParent;
typedef ::mozilla::_ipdltest::PTestJSONHandleChild PTestJSONHandleChild;
typedef ::mozilla::_ipdltest::KeyValue KeyValue;
typedef void_t void_t__tdef;
typedef null_t null_t__tdef;
typedef bool bool__tdef;
typedef int int__tdef;
typedef double double__tdef;
typedef nsString nsString__tdef;
typedef mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>> PTestJSONHandle__tdef;
typedef nsTArray<KeyValue>* ArrayOfKeyValue__tdef;
typedef nsTArray<JSONVariant>* ArrayOfJSONVariant__tdef;
void_t*
ptr_void_t()
{
return (&(mVvoid_t));
}
const void_t*
constptr_void_t() const
{
return (&(mVvoid_t));
}
null_t*
ptr_null_t()
{
return (&(mVnull_t));
}
const null_t*
constptr_null_t() const
{
return (&(mVnull_t));
}
bool*
ptr_bool()
{
return (&(mVbool));
}
const bool*
constptr_bool() const
{
return (&(mVbool));
}
int*
ptr_int()
{
return (&(mVint));
}
const int*
constptr_int() const
{
return (&(mVint));
}
double*
ptr_double()
{
return (&(mVdouble));
}
const double*
constptr_double() const
{
return (&(mVdouble));
}
nsString*
ptr_nsString()
{
return (&(mVnsString));
}
const nsString*
constptr_nsString() const
{
return (&(mVnsString));
}
mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>*
ptr_PTestJSONHandle()
{
return (&(mVPTestJSONHandle));
}
const mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>*
constptr_PTestJSONHandle() const
{
return (&(mVPTestJSONHandle));
}
nsTArray<KeyValue>*&
ptr_ArrayOfKeyValue()
{
return mVArrayOfKeyValue;
}
const nsTArray<KeyValue>*
constptr_ArrayOfKeyValue() const
{
return mVArrayOfKeyValue;
}
nsTArray<JSONVariant>*&
ptr_ArrayOfJSONVariant()
{
return mVArrayOfJSONVariant;
}
const nsTArray<JSONVariant>*
constptr_ArrayOfJSONVariant() const
{
return mVArrayOfJSONVariant;
}
void
MaybeDestroy();
void
AssertSanity() const
{
MOZ_RELEASE_ASSERT((T__None) <= (mType), "invalid type tag");
MOZ_RELEASE_ASSERT((mType) <= (T__Last), "invalid type tag");
}
void
AssertSanity(Type aType) const
{
AssertSanity();
MOZ_RELEASE_ASSERT((mType) == (aType), "unexpected type tag");
}
public:
MOZ_IMPLICIT JSONVariant() :
mType(T__None)
{
}
MOZ_IMPLICIT JSONVariant(const void_t& aOther);
MOZ_IMPLICIT JSONVariant(void_t&& aOther);
MOZ_IMPLICIT JSONVariant(const null_t& aOther);
MOZ_IMPLICIT JSONVariant(null_t&& aOther);
MOZ_IMPLICIT JSONVariant(const bool& aOther);
MOZ_IMPLICIT JSONVariant(bool&& aOther);
MOZ_IMPLICIT JSONVariant(const int& aOther);
MOZ_IMPLICIT JSONVariant(int&& aOther);
MOZ_IMPLICIT JSONVariant(const double& aOther);
MOZ_IMPLICIT JSONVariant(double&& aOther);
MOZ_IMPLICIT JSONVariant(const nsString& aOther);
MOZ_IMPLICIT JSONVariant(nsString&& aOther);
MOZ_IMPLICIT JSONVariant(const mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>& aOther);
MOZ_IMPLICIT JSONVariant(mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>&& aOther);
MOZ_IMPLICIT JSONVariant(const nsTArray<KeyValue>& aOther);
MOZ_IMPLICIT JSONVariant(nsTArray<KeyValue>&& aOther);
MOZ_IMPLICIT JSONVariant(const nsTArray<JSONVariant>& aOther);
MOZ_IMPLICIT JSONVariant(nsTArray<JSONVariant>&& aOther);
MOZ_IMPLICIT JSONVariant(const JSONVariant& aOther);
MOZ_IMPLICIT JSONVariant(JSONVariant&& aOther);
~JSONVariant();
Type
type() const
{
return mType;
}
JSONVariant&
operator=(const void_t& aRhs);
JSONVariant&
operator=(void_t&& aRhs);
JSONVariant&
operator=(const null_t& aRhs);
JSONVariant&
operator=(null_t&& aRhs);
JSONVariant&
operator=(const bool& aRhs);
JSONVariant&
operator=(bool&& aRhs);
JSONVariant&
operator=(const int& aRhs);
JSONVariant&
operator=(int&& aRhs);
JSONVariant&
operator=(const double& aRhs);
JSONVariant&
operator=(double&& aRhs);
JSONVariant&
operator=(const nsString& aRhs);
JSONVariant&
operator=(nsString&& aRhs);
JSONVariant&
operator=(const mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>& aRhs);
JSONVariant&
operator=(mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>&& aRhs);
JSONVariant&
operator=(const nsTArray<KeyValue>& aRhs);
JSONVariant&
operator=(nsTArray<KeyValue>&& aRhs);
JSONVariant&
operator=(const nsTArray<JSONVariant>& aRhs);
JSONVariant&
operator=(nsTArray<JSONVariant>&& aRhs);
JSONVariant&
operator=(const JSONVariant& aRhs);
JSONVariant&
operator=(JSONVariant&& aRhs);
bool
operator==(const void_t& aRhs) const;
bool
operator==(const null_t& aRhs) const;
bool
operator==(const bool& aRhs) const;
bool
operator==(const int& aRhs) const;
bool
operator==(const double& aRhs) const;
bool
operator==(const nsString& aRhs) const;
bool
operator==(const mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>& aRhs) const;
bool
operator==(const nsTArray<KeyValue>& aRhs) const;
bool
operator==(const nsTArray<JSONVariant>& aRhs) const;
bool
operator==(const JSONVariant& aRhs) const;
void_t&
get_void_t()
{
AssertSanity(Tvoid_t);
return (*(ptr_void_t()));
}
const void_t&
get_void_t() const
{
AssertSanity(Tvoid_t);
return (*(constptr_void_t()));
}
operator void_t&()
{
return get_void_t();
}
operator const void_t&() const
{
return get_void_t();
}
null_t&
get_null_t()
{
AssertSanity(Tnull_t);
return (*(ptr_null_t()));
}
const null_t&
get_null_t() const
{
AssertSanity(Tnull_t);
return (*(constptr_null_t()));
}
operator null_t&()
{
return get_null_t();
}
operator const null_t&() const
{
return get_null_t();
}
bool&
get_bool()
{
AssertSanity(Tbool);
return (*(ptr_bool()));
}
const bool&
get_bool() const
{
AssertSanity(Tbool);
return (*(constptr_bool()));
}
operator bool&()
{
return get_bool();
}
operator const bool&() const
{
return get_bool();
}
int&
get_int()
{
AssertSanity(Tint);
return (*(ptr_int()));
}
const int&
get_int() const
{
AssertSanity(Tint);
return (*(constptr_int()));
}
operator int&()
{
return get_int();
}
operator const int&() const
{
return get_int();
}
double&
get_double()
{
AssertSanity(Tdouble);
return (*(ptr_double()));
}
const double&
get_double() const
{
AssertSanity(Tdouble);
return (*(constptr_double()));
}
operator double&()
{
return get_double();
}
operator const double&() const
{
return get_double();
}
nsString&
get_nsString()
{
AssertSanity(TnsString);
return (*(ptr_nsString()));
}
const nsString&
get_nsString() const
{
AssertSanity(TnsString);
return (*(constptr_nsString()));
}
operator nsString&()
{
return get_nsString();
}
operator const nsString&() const
{
return get_nsString();
}
mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>&
get_PTestJSONHandle()
{
AssertSanity(TPTestJSONHandle);
return (*(ptr_PTestJSONHandle()));
}
const mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>&
get_PTestJSONHandle() const
{
AssertSanity(TPTestJSONHandle);
return (*(constptr_PTestJSONHandle()));
}
operator mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>&()
{
return get_PTestJSONHandle();
}
operator const mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>&() const
{
return get_PTestJSONHandle();
}
nsTArray<KeyValue>&
get_ArrayOfKeyValue()
{
AssertSanity(TArrayOfKeyValue);
return (*(ptr_ArrayOfKeyValue()));
}
const nsTArray<KeyValue>&
get_ArrayOfKeyValue() const
{
AssertSanity(TArrayOfKeyValue);
return (*(constptr_ArrayOfKeyValue()));
}
operator nsTArray<KeyValue>&()
{
return get_ArrayOfKeyValue();
}
operator const nsTArray<KeyValue>&() const
{
return get_ArrayOfKeyValue();
}
nsTArray<JSONVariant>&
get_ArrayOfJSONVariant()
{
AssertSanity(TArrayOfJSONVariant);
return (*(ptr_ArrayOfJSONVariant()));
}
const nsTArray<JSONVariant>&
get_ArrayOfJSONVariant() const
{
AssertSanity(TArrayOfJSONVariant);
return (*(constptr_ArrayOfJSONVariant()));
}
operator nsTArray<JSONVariant>&()
{
return get_ArrayOfJSONVariant();
}
operator const nsTArray<JSONVariant>&() const
{
return get_ArrayOfJSONVariant();
}
private:
union {
void_t mVvoid_t;
null_t mVnull_t;
bool mVbool;
int mVint;
double mVdouble;
nsString mVnsString;
mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>> mVPTestJSONHandle;
nsTArray<KeyValue>* mVArrayOfKeyValue;
nsTArray<JSONVariant>* mVArrayOfJSONVariant;
};
Type mType;
};
} // namespace _ipdltest
} // namespace mozilla
namespace IPC {
template<>
struct ParamTraits <::mozilla::_ipdltest::JSONVariant>
{
typedef ::mozilla::_ipdltest::JSONVariant paramType;
static void
Write(
IPC::MessageWriter* aWriter,
const paramType& aVar);
static IPC::ReadResult<paramType>
Read(IPC::MessageReader* aReader);
};
} // namespace IPC
//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct KeyValue|
//
namespace mozilla {
namespace _ipdltest {
class KeyValue final
{
private:
typedef ::nsString nsString;
typedef ::mozilla::_ipdltest::JSONVariant JSONVariant;
public:
#ifdef __clang__
# pragma clang diagnostic push
# if __has_warning("-Wdefaulted-function-deleted")
# pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
# endif
#endif
KeyValue() = default;
#ifdef __clang__
# pragma clang diagnostic pop
#endif
MOZ_IMPLICIT KeyValue(
const nsString& _key,
const JSONVariant& _value) :
key_(_key),
value_(_value)
{
}
MOZ_IMPLICIT KeyValue(
nsString&& _key,
JSONVariant&& _value) :
key_(std::move(_key)),
value_(std::move(_value))
{
}
bool
operator==(const KeyValue& _o) const;
bool
operator!=(const KeyValue& _o) const;
nsString&
key()
{
return key_;
}
const nsString&
key() const
{
return key_;
}
JSONVariant&
value()
{
return value_;
}
const JSONVariant&
value() const
{
return value_;
}
private:
::mozilla::ipc::IPDLStructMember<nsString> key_;
::mozilla::ipc::IPDLStructMember<JSONVariant> value_;
};
} // namespace _ipdltest
} // namespace mozilla
namespace IPC {
template<>
struct ParamTraits <::mozilla::_ipdltest::KeyValue>
{
typedef ::mozilla::_ipdltest::KeyValue paramType;
static void
Write(
IPC::MessageWriter* aWriter,
const paramType& aVar);
static IPC::ReadResult<paramType>
Read(IPC::MessageReader* aReader);
};
} // namespace IPC
namespace mozilla {
namespace _ipdltest {
class PTestJSONParent;
} // namespace _ipdltest
} // namespace mozilla
namespace mozilla {
namespace _ipdltest {
class PTestJSONChild;
} // namespace _ipdltest
} // namespace mozilla
//-----------------------------------------------------------------------------
// Code common to PTestJSONChild and PTestJSONParent
//
namespace mozilla {
namespace _ipdltest {
namespace PTestJSON {
nsresult
CreateEndpoints(
mozilla::ipc::EndpointProcInfo aParentDestInfo,
mozilla::ipc::EndpointProcInfo aChildDestInfo,
mozilla::ipc::Endpoint<::mozilla::_ipdltest::PTestJSONParent>* aParent,
mozilla::ipc::Endpoint<::mozilla::_ipdltest::PTestJSONChild>* aChild);
nsresult
CreateEndpoints(
mozilla::ipc::Endpoint<::mozilla::_ipdltest::PTestJSONParent>* aParent,
mozilla::ipc::Endpoint<::mozilla::_ipdltest::PTestJSONChild>* aChild);
enum MessageType {
PTestJSONStart = PTestJSONMsgStart << 16,
Msg_Start__ID,
Msg_PTestJSONHandleConstructor__ID,
Reply_PTestJSONHandleConstructor__ID,
Msg_Test__ID,
Reply_Test__ID,
Msg___delete____ID,
Reply___delete____ID,
PTestJSONEnd
};
mozilla::UniquePtr<IPC::Message>
Msg_Start(int32_t routingId);
mozilla::UniquePtr<IPC::Message>
Msg_PTestJSONHandleConstructor(int32_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply_PTestJSONHandleConstructor(int32_t routingId);
mozilla::UniquePtr<IPC::Message>
Msg_Test(int32_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply_Test(int32_t routingId);
mozilla::UniquePtr<IPC::Message>
Msg___delete__(int32_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply___delete__(int32_t routingId);
} // namespace PTestJSON
} // namespace _ipdltest
} // namespace mozilla
#endif // ifndef PTestJSON_h