1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef LIBRARIES_NACL_IO_PEPPER_INTERFACE_DUMMY_H_
6 #define LIBRARIES_NACL_IO_PEPPER_INTERFACE_DUMMY_H_
8 #include "nacl_io/pepper_interface.h"
10 // This class simplifies implementing a PepperInterface-derived class where you
11 // don't care about certain interfaces. All interface-getters return NULL by
16 // class FooPepperInterface : public PepperInterfaceDummy {
18 // CoreInterface* GetCoreInterface() { ... };
21 // // FooPepperInterface is not abstract -- all pure virtual functions have
22 // been defined to return NULL.
26 class PepperInterfaceDummy
: public PepperInterface
{
28 PepperInterfaceDummy() {}
29 virtual ~PepperInterfaceDummy() {}
30 virtual PP_Instance
GetInstance() { return 0; }
33 #include "nacl_io/pepper/undef_macros.h"
34 #include "nacl_io/pepper/define_empty_macros.h"
35 #undef BEGIN_INTERFACE
36 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \
37 virtual BaseClass* Get##BaseClass() { return NULL; }
38 #include "nacl_io/pepper/all_interfaces.h"
41 } // namespace nacl_io
43 #endif // LIBRARIES_NACL_IO_PEPPER_INTERFACE_DUMMY_H_