Author: jstephens
Date: 2007-03-28 14:22:33 +0200 (Wed, 28 Mar 2007)
New Revision: 5600
Log:
Checking bit values in results from NdbOperation::getValue() (Tomas)
Modified:
trunk/ndbapi/ndb-classes.xml
Modified: trunk/ndbapi/ndb-classes.xml
===================================================================
--- trunk/ndbapi/ndb-classes.xml 2007-03-28 10:36:28 UTC (rev 5599)
+++ trunk/ndbapi/ndb-classes.xml 2007-03-28 12:22:33 UTC (rev 5600)
Changed blocks: 2, Lines Added: 49, Lines Deleted: 17; 3054 bytes
@@ -28357,23 +28357,8 @@
</para>
</formalpara>
-
- <para>
- Integer values can be retrieved from both the
- <replaceable>value</replaceable> buffer passed as this
- method's second parameter, and from the
- <literal>NdbRecAttr</literal> object itself. On the other
- hand, character data is available from
- <literal>NdbRecAttr</literal> (see
- <xref linkend="class-ndbrecattr-aref"/>) only if no buffer was
- passed in to <literal>getValue()</literal>. However, character
- data is written to the buffer only if one is provided, in
- which case it cannot be retrieved from the
- <literal>NdbRecAttr</literal> object that was returned. In the
- latter case, <literal>NdbRecAttr::aRef()</literal> returns a
- buffer pointing to an empty string.
- </para>
-
+
+
<formalpara>
<title>Return Value</title>
@@ -28385,7 +28370,54 @@
</para>
</formalpara>
+
+ <formalpara>
+ <title>Retrieving integers</title>
+
+ <para>
+ Integer values can be retrieved from both the
+ <replaceable>value</replaceable> buffer passed as this
+ method's second parameter, and from the
+ <literal>NdbRecAttr</literal> object itself. On the other
+ hand, character data is available from
+ <literal>NdbRecAttr</literal> (see
+ <xref linkend="class-ndbrecattr-aref"/>) only if no buffer
+ was passed in to <literal>getValue()</literal>. However,
+ character data is written to the buffer only if one is
+ provided, in which case it cannot be retrieved from the
+ <literal>NdbRecAttr</literal> object that was returned. In
+ the latter case, <literal>NdbRecAttr::aRef()</literal>
+ returns a buffer pointing to an empty string.
+ </para>
+ </formalpara>
+
+ <formalpara>
+ <title>Accessing bit values</title>
+
+ <para>
+ The following example shows how to check a given bit from
+ the <replaceable>value</replaceable> buffer. Here,
+ <literal>op</literal> is an operation
+ (<literal>NdbOperation</literal> object),
+ <literal>name</literal> is the name of the column from which
+ to get the bit value, and <literal>trans</literal> is an
+ <literal>NdbTransaction</literal> object.
+
+<programlisting>
+Uint32 buf[];
+op->getValue(name, buf); /* bit column */
+
+trans->execute();
+
+if(buf[X/32] & 1 << (X & 31)) /* check bit X */
+{
+ /* bit X set */
+}
+</programlisting>
+ </para>
+ </formalpara>
+
<!--
<formalpara>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r5600 - trunk/ndbapi | jon | 28 Mar |