search for: getter

Displaying 20 results from an estimated 312 matches for "getter".

Did you mean: better
2015 Nov 20
1
Good practice for naming classes, builders, attributes, getters/setters for object composition
Hey everyone, I am developing a package and I am wondering if there is a good practice for naming classes, builders, attributes getters and setters when dealing with object composition. I know that it is usually a good practice to give to the builder the same name as the class and, if possible, to avoid to use upper case letters. My problem is that, when I build an object containing an other object (of an other class), at the end...
2011 Jul 30
22
Question about Helpers
Studying the RoR 3 Tutorial book by Michael Hartl and on page 345 there''s the code inside the SessionsHelper: _________________________________________________________ module SessionsHelper def sign_in(user) cookies.permanent.signed[:remember_token] = [user.id, user.sault] self.current_user = user end end __________________________________________________________ What is the purpose
2010 Apr 18
1
Getter and Setter with non DB property
Hi, I can''t find how do i created a getter and setter property for a non db property. what i have done isnt working, i have a cnt mass assign error. Here is what i''ve done: attr_accessor :creator_is_participant def creator_is_participant @participe end def creator_is_participant=(participe) if participe == true...
2008 May 18
4
[LLVMdev] Opaque type usage to represent foreign types
In my project I have a group of foreign types (C++ classes) that I want to use, but don't want to represent as structs within LLVM. For example, for each field in each C++ class I have a setter and getter function that I'd like to use. The setters and getters are "extern C" functions to avoid problems with C++'s name mangling. After going over the documentation it seems like I can do this by creating a unique opaque type for each C++ class to track types during my compila...
2006 Jun 01
1
Automatted Getter/Setter
Hey.. So I have a model that has a lot of number fields. Each of these go through a process when read in and read out to add/remove commas (between every three numbers) to make them more readable. The getter I currently have is like this: def sale_price Listing.insert_commas(read_attribte (:sale_price)) end and the setter is: def sale_price=(price) write_attribute(:saleprice, Listing.remove_commas(price)) end The trouble is there is at least 5 other fields that need the same thing done for the...
2006 Jul 13
4
Does text_field go directly to attributes hash in AR object?
All, I''m having a hell of a time figuring out what is going on here. I''m trying to override one of my getters so that I can format it a certain way in my form. But I can''t seem to get text_field to call the appropriate method on my object. So here''s my getter: public def FAX fax = read_attribute(:FAX) puts fax sprintf("(%d)%d-%d", fax[0,3], fax[3,3], fax[6,...
2014 Mar 05
2
[LLVMdev] [cfe-dev] C++11 reverse iterators (was C++11 is here)
This rule does not seem to be widely followed by Clang today. Looking at Parser and Sema, many getters (0 argument functions with names matching /^get[A-Z]/) return mutable references to long-lived objects. Looking through Decl.h, things are a little different: we rarely return references, but do frequently return pointers that provide mutable access to contained objects. On Tue, Mar 4, 2014 at 5...
2006 Jul 03
4
text_field doesn''t call overridden ActiveRecord getters
...#39;) end However, when I attempt to render this in my template, the default formatted database value of the DateReceived timestamp column is displayed instead of my specially formatted version that I return from the DateReceived method. Does text_field generate code that bypasses overridden getter methods for an ActiveRecord object? Wes -- Posted via http://www.ruby-forum.com/.
2009 Oct 14
1
Cacheing computationally expensive getter methods for S4 objects
Hi, I was wondering if there was a way to store the results of a computationally expensive "getter" call on an S4 object, so that it is only calculated once for each object. Trivial example: let's say I want to cache the "expensive" area calculation of a square object. setClass("Square", representation( length='numeric', width='numeric&...
2020 Sep 07
0
Re: [libnbd PATCH 0/3] Improve type-safety of ocaml/golang getters
...e time the C app was compiled, the libnbd call that checks that all > input bits are known is from the newer libnbd that recognizes > LIBNBD_HANDSHAKE_FLAG_64BIT as valid). But an OCaml client compiled > against the older interface has no OCaml value to represent the new > bit from the getter, nor any way to specify that new bit to the setter > that is expecting a list of only the old variant type. Maybe we want > the generator to produce a full list of 31 variants per 'flags' type, > using placeholders for all bits not currently in use, to make it > easier to recei...
2014 Mar 04
2
[LLVMdev] [cfe-dev] C++11 reverse iterators (was C++11 is here)
On Mar 3, 2014, at 10:29 AM, Chandler Carruth <chandlerc at google.com> wrote: > > On Mon, Mar 3, 2014 at 9:48 AM, Chris Lattner <sabre at nondot.org> wrote: >> In the best case 'get' doesn't really add any meaning, and in the worst case it is actively misleading > > It's getting the range though, just like Function::getArgumentList() returns the
2013 Feb 05
0
[LLVMdev] RFC: Replacing publicly accessible class IDs with getters
...r symbols imported by Polly from clang. This > allows the Polly dll to be loaded into any executable that provides the required > symbols. However delay loading precludes the importing of data[1]. > > We would like to resolve these issues by replacing public access of the ID with > a getter: > > class AliasAnalysis { > > private: > static char ID; // Class identification, replacement for typeinfo > > public: > static const void *getClassPassID(); > }; That said, this looks pretty reasonable to me. Ciao, Duncan. > > >...
2011 May 26
0
Reference Classes: getter and setter functions/methods and possible shortcuts
Hi everyone, just wanted to ask what's the smartest/recommended way of defining getter and setter function *shortcuts* (i.e. something like "[", "[<-") for Reference Class objects? Or is it desired to not use this stuff, but define methods like 'obj$getSubset(row=1:3, col=1)' and 'obj$setSubset(value=x)' instead? I have some example code that...
2011 Dec 02
2
[LLVMdev] deglobalizing TargetOptions
...s that the TargetOptions are all global; you could create a >> TargetMachine targeting ARM and X86 in two threads, but they both have >> to share the same FloatABIType setting. >> >> This is silly, and I plan to fix it by moving all the globals in >> TargetOptions into getters and setters on TargetMachine. This means >> that the TargetMachine object is going to get a bit bigger to >> accommodate, but at least two users of llvm linked into one program >> won't step on each other. > > Sounds great. > >> The existing command-line option...
2013 Jan 30
3
[LLVMdev] RFC: Replacing publicly accessible class IDs with getters
...use delay loading for symbols imported by Polly from clang. This allows the Polly dll to be loaded into any executable that provides the required symbols. However delay loading precludes the importing of data[1]. We would like to resolve these issues by replacing public access of the ID with a getter: class AliasAnalysis { private: static char ID; // Class identification, replacement for typeinfo public: static const void *getClassPassID(); }; Thoughts? Matthew Curtis [1] http://msdn.microsoft.com/en-us/library/yx1x886y.aspx -- Qualcomm Innovation Center...
2013 Feb 01
2
[LLVMdev] RFC: Replacing publicly accessible class IDs with getters
...symbols imported by Polly from clang. This > allows the Polly dll to be loaded into any executable that provides the > required symbols. However delay loading precludes the importing of data[1]. > > We would like to resolve these issues by replacing public access of the ID with > a getter: > > class AliasAnalysis { > > private: > static char ID; // Class identification, replacement for typeinfo > > public: > static const void *getClassPassID(); > }; I think that would be O.K., but why getClassPassID return "const void...
2013 Feb 04
0
[LLVMdev] RFC: Replacing publicly accessible class IDs with getters
...y Polly from clang. This >> allows the Polly dll to be loaded into any executable that provides the >> required symbols. However delay loading precludes the importing of data[1]. >> >> We would like to resolve these issues by replacing public access of the ID with >> a getter: >> >> class AliasAnalysis { >> >> private: >> static char ID; // Class identification, replacement for typeinfo >> >> public: >> static const void *getClassPassID(); >> }; > I think that would be O.K., bu...
2011 Dec 02
2
[LLVMdev] deglobalizing TargetOptions
...a library. One of the things that I found is that the TargetOptions are all global; you could create a TargetMachine targeting ARM and X86 in two threads, but they both have to share the same FloatABIType setting. This is silly, and I plan to fix it by moving all the globals in TargetOptions into getters and setters on TargetMachine. This means that the TargetMachine object is going to get a bit bigger to accommodate, but at least two users of llvm linked into one program won't step on each other. The existing command-line options will move from TargetMachine into llc which will use the same s...
2008 Apr 25
3
[ANNOUNCE] Samba 3.2.0pre3
...ations, and no changes need be made for many applications. The changes required for KDE (konqueror) to conform to the new interface, for example, are only four lines in only one file. Instead of the application manually changing or reading values in the context structure, there are now setter and getter functions for each configurable member in that structure. Similarly, the smbc_option_get() and smbc_option_set() functions are deprecated in favor of the setter/getter interface. The setters and getters are all documented in libsmbclient.h under these comment blocks: Getters and setters for CO...
2008 Apr 25
3
[ANNOUNCE] Samba 3.2.0pre3
...ations, and no changes need be made for many applications. The changes required for KDE (konqueror) to conform to the new interface, for example, are only four lines in only one file. Instead of the application manually changing or reading values in the context structure, there are now setter and getter functions for each configurable member in that structure. Similarly, the smbc_option_get() and smbc_option_set() functions are deprecated in favor of the setter/getter interface. The setters and getters are all documented in libsmbclient.h under these comment blocks: Getters and setters for CO...