Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#ifndef PTestUniquePtrIPC_h
#define PTestUniquePtrIPC_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/IPDLStructMember.h"
#include "string"
//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct DummyStruct|
//
namespace mozilla {
namespace _ipdltest {
class DummyStruct final
{
private:
typedef ::std::string string;
public:
#ifdef __clang__
# pragma clang diagnostic push
# if __has_warning("-Wdefaulted-function-deleted")
# pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
# endif
#endif
DummyStruct() = default;
#ifdef __clang__
# pragma clang diagnostic pop
#endif
MOZ_IMPLICIT DummyStruct(const string& _x) :
x_(_x)
{
}
MOZ_IMPLICIT DummyStruct(string&& _x) :
x_(std::move(_x))
{
}
string&
x()
{
return x_;
}
const string&
x() const
{
return x_;
}
private:
::mozilla::ipc::IPDLStructMember<string> x_;
};
} // namespace _ipdltest
} // namespace mozilla
namespace IPC {
template<>
struct ParamTraits <::mozilla::_ipdltest::DummyStruct>
{
typedef ::mozilla::_ipdltest::DummyStruct 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 |union DummyUnion|
//
namespace mozilla {
namespace _ipdltest {
class DummyUnion final
{
public:
enum Type {
T__None,
Tstring = 1,
Tint,
T__Last = Tint
};
private:
typedef ::std::string string;
typedef UniquePtr<string> string__tdef;
typedef int int__tdef;
union Value {
mozilla::AlignedStorage2<UniquePtr<string>> Vstring;
mozilla::AlignedStorage2<int> Vint;
};
UniquePtr<string>*
ptr_string()
{
return ((mValue).Vstring).addr();
}
const UniquePtr<string>*
constptr_string() const
{
return ((mValue).Vstring).addr();
}
int*
ptr_int()
{
return ((mValue).Vint).addr();
}
const int*
constptr_int() const
{
return ((mValue).Vint).addr();
}
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 DummyUnion() :
mType(T__None)
{
}
MOZ_IMPLICIT DummyUnion(UniquePtr<string>&& aOther);
MOZ_IMPLICIT DummyUnion(const int& aOther);
MOZ_IMPLICIT DummyUnion(int&& aOther);
MOZ_IMPLICIT DummyUnion(DummyUnion&& aOther);
~DummyUnion();
Type
type() const
{
return mType;
}
DummyUnion&
operator=(UniquePtr<string>&& aRhs);
DummyUnion&
operator=(const int& aRhs);
DummyUnion&
operator=(int&& aRhs);
DummyUnion&
operator=(DummyUnion&& aRhs);
UniquePtr<string>&
get_string()
{
AssertSanity(Tstring);
return (*(ptr_string()));
}
const UniquePtr<string>&
get_string() const
{
AssertSanity(Tstring);
return (*(constptr_string()));
}
operator UniquePtr<string>&()
{
return get_string();
}
operator const UniquePtr<string>&() const
{
return get_string();
}
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();
}
private:
Value mValue;
Type mType;
};
} // namespace _ipdltest
} // namespace mozilla
namespace IPC {
template<>
struct ParamTraits <::mozilla::_ipdltest::DummyUnion>
{
typedef ::mozilla::_ipdltest::DummyUnion 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 PTestUniquePtrIPCParent;
} // namespace _ipdltest
} // namespace mozilla
namespace mozilla {
namespace _ipdltest {
class PTestUniquePtrIPCChild;
} // namespace _ipdltest
} // namespace mozilla
//-----------------------------------------------------------------------------
// Code common to PTestUniquePtrIPCChild and PTestUniquePtrIPCParent
//
namespace mozilla {
namespace _ipdltest {
namespace PTestUniquePtrIPC {
nsresult
CreateEndpoints(
base::ProcessId aParentDestPid,
base::ProcessId aChildDestPid,
mozilla::ipc::Endpoint<::mozilla::_ipdltest::PTestUniquePtrIPCParent>* aParent,
mozilla::ipc::Endpoint<::mozilla::_ipdltest::PTestUniquePtrIPCChild>* aChild);
nsresult
CreateEndpoints(
mozilla::ipc::Endpoint<::mozilla::_ipdltest::PTestUniquePtrIPCParent>* aParent,
mozilla::ipc::Endpoint<::mozilla::_ipdltest::PTestUniquePtrIPCChild>* aChild);
enum MessageType {
PTestUniquePtrIPCStart = PTestUniquePtrIPCMsgStart << 16,
Msg_TestMessage__ID,
Msg_TestSendReference__ID,
PTestUniquePtrIPCEnd
};
mozilla::UniquePtr<IPC::Message>
Msg_TestMessage(int32_t routingId);
mozilla::UniquePtr<IPC::Message>
Msg_TestSendReference(int32_t routingId);
} // namespace PTestUniquePtrIPC
} // namespace _ipdltest
} // namespace mozilla
#endif // ifndef PTestUniquePtrIPC_h