OLD | NEW |
| (Empty) |
1 // Copyright (c) 2010 The FakeInstance Project 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. | |
4 | |
5 #include "c_salt/integration_tests/fake_instance.h" | |
6 | |
7 FakeInstance::FakeInstance(const NPP& npp_instance) | |
8 : c_salt::Instance(npp_instance), | |
9 method_tester_(new MethodTester()), | |
10 property_tester_(new PropertyTester()) { | |
11 this->CreateScriptingBridgeForObject(method_tester_); | |
12 this->CreateScriptingBridgeForObject(property_tester_); | |
13 } | |
14 | |
15 FakeInstance::~FakeInstance() { | |
16 } | |
17 | |
18 void FakeInstance::InitializeMethods(c_salt::ScriptingBridge* bridge) { | |
19 bridge->AddMethodNamed("getMethodTester", | |
20 this, | |
21 &FakeInstance::GetMethodTester); | |
22 bridge->AddMethodNamed("getPropertyTester", | |
23 this, | |
24 &FakeInstance::GetPropertyTester); | |
25 } | |
26 | |
27 void FakeInstance::InitializeProperties(c_salt::ScriptingBridge* bridge) { | |
28 // No properties (yet) | |
29 } | |
30 | |
31 boost::shared_ptr<MethodTester> FakeInstance::GetMethodTester() { | |
32 return method_tester_; | |
33 } | |
34 | |
35 boost::shared_ptr<PropertyTester> FakeInstance::GetPropertyTester() { | |
36 return property_tester_; | |
37 } | |
OLD | NEW |