kjs Library API Documentation

KJS::MathObjectImp Class Reference

Inheritance diagram for KJS::MathObjectImp:

KJS::ObjectImp KJS::ValueImp List of all members.

Public Types

enum  {
  Euler, Ln2, Ln10, Log2E,
  Log10E, Pi, Sqrt1_2, Sqrt2,
  Abs, ACos, ASin, ATan,
  ATan2, Ceil, Cos, Pow,
  Exp, Floor, Log, Max,
  Min, Random, Round, Sin,
  Sqrt, Tan
}

Public Member Functions

 MathObjectImp (ExecState *exec, ObjectPrototypeImp *objProto)
Value get (ExecState *exec, const Identifier &p) const
Value getValueProperty (ExecState *exec, int token) const
virtual const ClassInfoclassInfo () const

Static Public Attributes

static const ClassInfo info = { "Math", 0, &mathTable, 0 }

Detailed Description

Definition at line 30 of file math_object.h.


Member Function Documentation

Value MathObjectImp::get ExecState exec,
const Identifier p
const [virtual]
 

Implementation of the [[Get]] internal property (implemented by all Objects).

See also:
Object::get()

Reimplemented from KJS::ObjectImp.

Definition at line 87 of file math_object.cpp.

References KJS::mathTable.

virtual const ClassInfo* KJS::MathObjectImp::classInfo  )  const [inline, virtual]
 

A pointer to a ClassInfo struct for this class.

This provides a basic facility for run-time type information, and can be used to check an object's class an inheritance (see inherits()). This should always return a statically declared pointer, or 0 to indicate that there is no class information.

This is primarily useful if you have application-defined classes that you wish to check against for casting purposes.

For example, to specify the class info for classes FooImp and BarImp, where FooImp inherits from BarImp, you would add the following in your class declarations:

   class BarImp : public ObjectImp {
     virtual const ClassInfo *classInfo() const { return &info; }
     static const ClassInfo info;
     // ...
   };

   class FooImp : public ObjectImp {
     virtual const ClassInfo *classInfo() const { return &info; }
     static const ClassInfo info;
     // ...
   };

And in your source file:

   const ClassInfo BarImp::info = {0, 0, 0}; // no parent class
   const ClassInfo FooImp::info = {&BarImp::info, 0, 0};

See also:
inherits()

Reimplemented from KJS::ObjectImp.

Definition at line 36 of file math_object.h.

References info.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kjs Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Nov 1 10:32:49 2005 by doxygen 1.4.3 written by Dimitri van Heesch, © 1997-2003