search for: _instance

Displaying 7 results from an estimated 7 matches for "_instance".

Did you mean: instance
2006 May 22
2
using Singleton with Prototype
Hello all. I''m writing my own object using prototype and I wonder how you write and call only one instance of class. Can anyone share his idea of singleton? thanks Gregor ---------------------------------------------------- Gdy nadchodzi przełomowy moment w historii, musisz zdecydować, po czyjej stronie będziesz. "X-Men: Ostatni bastion" - w kinach od 26 maja.
2010 Apr 21
1
[PATCH matahari] Created a new platform-abstraction layer named Platform.
...ware + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. A copy of the GNU General Public License is + * also available at http://www.gnu.org/copyleft/gpl.html. + */ + +#include "platform.h" +#include "linux_platform.h" + +Platform* Platform::_instance = 0; + +Platform* +Platform::instance() +{ + // TODO this is where we decide which implementation to use + if(!_instance) + { + _instance = new LinuxPlatform; + } + + return _instance; +} diff --git a/src/platform.h b/src/platform.h new file mode 100644 index 0000000..514ad20 --- /dev...
2004 Sep 21
1
win32-shortcut problems
...made a toplevel dir as well - it''s empty). Anyway, everything compiles fine, but when I do "s = Shortcut.new" I get a weird error: test.rb:11:in `initialize'': undefined method `new'' for false:FalseClass (NoMethodError) The initialize method is copied from the _Instance(...) part of the Shortcut.xs file. Any ideas as to what''s wrong? Regards, Dan
2010 May 27
1
[PATCH matahari] Introduces a multiplexer for taking requests and mapping them to APIs.
...he Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. A copy of the GNU General Public License is + * also available at http://www.gnu.org/copyleft/gpl.html. + */ + +#include "multiplexer.h" + +// the singleton +Multiplexer* Multiplexer::_instance = new Multiplexer(); + +typedef map<string, t_apifunction> APIMAP; + +Multiplexer::Multiplexer() +{} + +Multiplexer* +Multiplexer::instance() +{ + return _instance; +} + +void +Multiplexer::registerAPI(string name, t_apifunction apifunction) +{ + _apis.insert(APIMAP::value_type(string(name)...
2006 Jul 06
2
Custom init. of ActiveRecord objects - best practices
All, I''m wanting to initialize an ActiveRecord object. I understand that there is a method called after_initialize that appears to get called right after the ActiveRecord object is instantiated. Is after_initialize a Ruby thing or a Rails thing? Where is after_initialize documented? Can I pass parameters to it? If so, how? I want to initialize the "belongs_to" attribute of
2012 Mar 26
2
[PATCH DOCDAY] docs: wrap misc/xen-command-line.markdown to 80 columns
...blacklisted. +Additionally, this will not prevent Xen from finding IO-APIC entries +from the MP tables. -Finally, any of the boolean false options can be used to disable ACPI usage entirely. +Finally, any of the boolean false options can be used to disable ACPI +usage entirely. ### acpi\_apic\_instance > `= <integer>` -Specify which ACPI MADT table to parse for APIC information, if more than one is present. +Specify which ACPI MADT table to parse for APIC information, if more +than one is present. ### acpi\_pstate\_strict ### acpi\_skip\_timer\_override @@ -86,7 +110,9 @@ Specify...
2010 May 24
0
[PATCH matahari] Moves the CPU properties into the Host API space.
...the broker hostAgent.setup(agent); - processorsAgent.setup(agent, &hostAgent); while(1) { diff --git a/src/platform.h b/src/platform.h index 54fbe37..ba70378 100644 --- a/src/platform.h +++ b/src/platform.h @@ -37,28 +37,24 @@ class Platform private: static Platform* _instance; - string processor_model; - unsigned int number_of_cores; + string _cpu_model; + unsigned int _cpu_cores; protected: Platform() {} virtual~ Platform() {} - void set_processor_model(const string model) { processor_model = model; } - void set_number_of_cores(const int numbe...