~ubuntu-branches/ubuntu/vivid/mygui/vivid

« back to all changes in this revision

Viewing changes to Wrappers/MyGUI_Managed/Delegate1.h

  • Committer: Package Import Robot
  • Author(s): Scott Howard, Bret Curtis, Scott Howard
  • Date: 2014-09-18 17:57:48 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140918175748-dd8va78mvpw1jbes
Tags: 3.2.1-1
[ Bret Curtis ]
* Updated license for majority of files from LGPL to Expat (MIT)

[ Scott Howard ]
* New upstream release
* Updated patch to add build option for system GLEW libraries
* All patches accepted upstream except shared_libraries.patch
* Bumped SONAME due to dropped symbols, updated *.symbols and package
  names
* Updated license of debian/* to Expat with permission of all authors
* Don't install Doxygen autogenerated md5 and map files (thanks
  lintian)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*!
 
2
        @file
 
3
        @author         Albert Semenov
 
4
        @date           01/2009
 
5
        @module
 
6
*/
 
7
#pragma once
 
8
 
 
9
#include <MyGUI.h>
 
10
#include <gcroot.h>
 
11
 
 
12
#include "Marshaling.h"
 
13
 
 
14
namespace MyGUI
 
15
{
 
16
        namespace Managed
 
17
        {
 
18
 
 
19
                template <typename MD, typename T1>
 
20
                class Delegate1 : public MyGUI::delegates::IDelegate1<T1>
 
21
                {
 
22
                public:
 
23
                        Delegate1 (MD _delegate) : mDelegate(_delegate) { }
 
24
 
 
25
                        virtual bool isType( const std::type_info& _type)
 
26
                        {
 
27
                                return typeid( Delegate1<MD, T1> ) == _type;
 
28
                        }
 
29
 
 
30
                        virtual void invoke( T1 p1 )
 
31
                        {
 
32
                                ((MD)mDelegate)(Convert<T1>::To(p1));
 
33
                        }
 
34
 
 
35
                        virtual bool compare(  MyGUI::delegates::IDelegate1<T1>  * _delegate) const
 
36
                        {
 
37
                                if (nullptr == _delegate || false == _delegate->isType(typeid(Delegate1<MD, T1>)) ) return false;
 
38
                                Delegate1<MD, T1> * cast = static_cast<Delegate1<MD, T1> *>(_delegate);
 
39
                                return ((MD)cast->mDelegate) == ((MD)mDelegate);
 
40
                        }
 
41
 
 
42
                private:
 
43
                        gcroot<MD> mDelegate;
 
44
                };
 
45
 
 
46
        } // namespace Managed
 
47
} // namespace MyGUI