Meta::MObject Class Reference

Provides the M interpreter, storing/restoring objects, cues, distributed objects, and more. More...

#include <MObject.h>

Inheritance diagram for Meta::MObject:
Meta::MProcessor Meta::MAgent Meta::MAuth Meta::MBasicObject Meta::MLibBase Meta::MMLEntity Meta::MRandom Meta::MVideoEncoderBase Meta::MHub Meta::MPackage Meta::MScope Meta::MTime Meta::MLib Meta::MMLGrid Meta::MMLRoot Meta::MMLSceneBase Meta::MMLSharedVar Meta::MVideoEncoder

List of all members.

Public Types

enum  RestoreOpt { Restore }
enum  AttributeMode {
  Raw, Exists, TryProtected, TryProtectedExists,
  Protected
}
typedef uint32_t ClassIdType

Public Member Functions

 MObject (bool basic=false)
 MObject (MBrokerBase *broker)
 MObject (const MObject &object)
 MObject (const mvar &v, RestoreOpt opt)
virtual ~MObject ()
virtual void store (mvar &v) const
virtual MObjectclone () const
MObjectoperator= (const MObject &object)
void lock ()
bool lock (const MTime &timeout)
bool tryLock ()
void unlock ()
virtual bool instanceOf (ClassIdType classId) const
virtual mnode process (mnode n, uint32_t flags=0)
mvar eval (const mvar &code)
mnode method (const mstr &name, size_t inputs)
mnode method (size_t i)
size_t methodCount () const
void setMethod (mnode sig, mnode body)
void setAttribute (const mstr &name, mnode n, AttributeMode mode=Raw)
mnode attribute (const mstr &name, AttributeMode mode=Raw)
mnode attribute (size_t i)
size_t attributeCount () const
mstr attributeName (size_t i) const
mnode remoteProcess (mnode f, bool block=true, mnode fail=0)
bool isRemote () const
bool isDistributed () const
bool isLocal () const
MBrokerBasebroker ()
mvarsession ()
const mvarsession () const
virtual void onClientClosed (const mvar &session)
virtual void onServerClosed ()
bool isConnected () const
bool release ()
MScopescope ()
void setClassName (const mstr &name)
const mstrclassName () const
void enableInterrupts (bool flag)
void connectCue (mnode source, MObject *receiver, mnode target)
void connectCue (mnode source, MObject *receiver)
void emitCue (mnode f)
void clearCues ()
void clearCues (MObject *receiver)
void clearReceiveCues ()
void clearReceiveCues (MObject *emitter)
bool inVirtual ()
void setStrict (bool flag)
bool isStrict () const
void setExact (bool flag)
bool isExact () const
bool isBasic () const
mnode Ret_ (mnode n)
mnode Def_ (mnode s, mnode v)
mnode Def_ (mnode scope, mnode s, mnode v)
mnode Param_ (mnode n)
mnode Len_ (mnode n)
mnode Undef_ (mnode n)
mnode For_ (mnode n1, mnode n2, mnode n3, mnode n4)
mnode ForEach_ (mnode item, mnode sequence, mnode block)
mnode Throw_ (mnode n, mnode msg)
mnode Throw_ (mnode n, mnode msg, mnode type)
mnode Get_ (mnode n)
mnode Get_ (mnode n, mnode nk)
mnode Set_ (mnode n, mnode v)
mnode Idx_ (mnode n, mnode nk)
mnode Symbols_ ()
mnode Attrs_ ()
mnode Functions_ ()
mnode Methods_ ()
mnode LRec_ (mnode n)
mnode LRec_ (mnode n, mnode k, mnode all)
mnode RRec_ (mnode n)
mnode RRec_ (mnode n, mnode k, mnode all)
mnode Flatten_ (mnode n1)
mnode GetI_ (mnode s)
mnode MGet_ (mnode s)
mnode PushScope_ (mnode s)
mnode Reset_ ()
mnode ResetGlobal_ ()
mnode ReDef_ (mnode s, mnode v)
mnode PopScope_ ()
mnode Scope_ ()
mnode Scope_ (mnode s)
mnode Scope_ (mnode s, mnode f)
mnode Class_ (mnode n1, mnode n2)
mnode MergeScope_ (mnode s1, mnode s2)
mnode OuterMergeScope_ (mnode s1, mnode s2)
mnode Ex_ (mnode n)
mnode Eval_ (mnode n)
mnode PreEval_ (mnode n1, mnode n2)
mnode CEval_ (mnode n)
mnode CEval_ (mnode n1, mnode n2)
mnode Lambda_ (mnode n1, mnode n2, mnode n3)
mnode Scoped_ (mnode f)
mnode Neg_ (mnode v)
mnode Add_ (mnode v1, mnode v2)
mnode Sub_ (mnode v1, mnode v2)
mnode Mul_ (mnode v1, mnode v2)
mnode Div_ (mnode v1, mnode v2)
mnode Inv_ (mnode v)
mnode Pow_ (mnode v1, mnode v2)
mnode Mod_ (mnode v1, mnode v2)
mnode Inc_ (mnode v)
mnode IncP_ (mnode v)
mnode Dec_ (mnode v)
mnode DecP_ (mnode v)
mnode AddA_ (mnode v1, mnode v2)
mnode SubA_ (mnode v1, mnode v2)
mnode MulA_ (mnode v1, mnode v2)
mnode DivA_ (mnode v1, mnode v2)
mnode ModA_ (mnode v1, mnode v2)
mnode Pi_ ()
mnode Euler_ ()
mnode Catalan_ ()
mnode Sqrt_ (mnode v)
mnode Abs_ (mnode v)
mnode Log10_ (mnode v)
mnode LogE_ (mnode v)
mnode Cos_ (mnode v)
mnode ACos_ (mnode v)
mnode CosH_ (mnode v)
mnode Sin_ (mnode v)
mnode ASin_ (mnode v)
mnode SinH_ (mnode v)
mnode Tan_ (mnode v)
mnode ATan_ (mnode v)
mnode ATan2_ (mnode y, mnode x)
mnode TanH_ (mnode v)
mnode Floor_ (mnode v)
mnode Ceil_ (mnode v)
mnode Exp_ (mnode v)
mnode Round_ (mnode v)
mnode Round_ (mnode v, mnode precision)
mnode If_ (mnode n1, mnode n2)
mnode If_ (mnode n1, mnode n2, mnode n3)
mnode Not_ (mnode n)
mnode And_ (mnode n1, mnode n2)
mnode Or_ (mnode n1, mnode n2)
mnode XOr_ (mnode n1, mnode n2)
mnode Alt_ (mnode v1, mnode v2)
mnode AltA_ (mnode v1, mnode v2)
mnode LT_ (mnode v1, mnode v2)
mnode GT_ (mnode v1, mnode v2)
mnode LE_ (mnode v1, mnode v2)
mnode GE_ (mnode v1, mnode v2)
mnode Eq_ (mnode v1, mnode v2)
mnode NE_ (mnode v1, mnode v2)
mnode Max_ (mnode v1, mnode v2)
mnode Min_ (mnode v1, mnode v2)
mnode While_ (mnode n1, mnode n2)
mnode Print_ (mnode n)
mnode Log_ (mnode n)
mnode Head_ (mnode n)
mnode Back_ (mnode n)
mnode Elem_ (mnode n, mnode ni)
mnode Match_ (mnode n1, mnode n2)
mnode Find_ (mnode n1, mnode n2)
mnode Itp_ (mnode s, mnode si)
mnode New_ (mnode n)
mnode Create_ (mnode n)
mnode Delete_ (mnode n)
mnode Clone_ (mnode n)
mnode Copy_ (mnode n)
mnode Call_ (mnode f)
mnode Args_ (mnode f)
mnode Params_ (mnode f)
mnode Once_ (mnode f)
mnode Type_ (mnode n1, mnode n2, mnode n3)
mnode Type_ (mnode n1, mnode n2, mnode n3, mnode n4)
mnode Method_ (mnode n1, mnode n2, mnode n3)
mnode Value_ (mnode n1, mnode n2, mnode n3)
mnode Expand_ (mnode n)
mnode Import_ (mnode n)
mnode MCode_ (mnode n)
mnode CodeData_ (mnode n)
mnode Show_ (mnode s)
mnode IsFunction_ (mnode n)
mnode IsSymbol_ (mnode n)
mnode IsNumeric_ (mnode n)
mnode IsString_ (mnode n)
mnode IsConstant_ (mnode n)
mnode IsTrue_ (mnode n)
mnode IsFalse_ (mnode n)
mnode Real_ (mnode r)
mnode Cls_ (mnode n)
mnode PushBack_ (mnode v, mnode x)
mnode PushFront_ (mnode v, mnode x)
mnode Push_ (mnode v, mnode x)
mnode PopBack_ (mnode v)
mnode PopFront_ (mnode v)
mnode Pop_ (mnode v)
mnode HasKey_ (mnode v, mnode k)
mnode Keys_ (mnode v)
mnode IsDefined_ (mnode v)
mnode IsEmpty_ (mnode v)
mnode Index_ (mnode v, mnode x)
mnode Index_ (mnode v, mnode x, mnode start)
mnode Index_ (mnode v, mnode x, mnode start, mnode end)
mnode Erase_ (mnode v, mnode k)
mnode Split_ (mnode v, mnode delimiter, mnode maxTokens)
mnode Split_ (mnode v, mnode delimiter)
mnode Join_ (mnode v, mnode delimiter)
mnode IndexMap_ (mnode v, mnode flag)
mnode ClearSeq_ (mnode v)
mnode ClearMap_ (mnode v)
mnode Clear_ (mnode v)
mnode Size_ (mnode v)
mnode Merge_ (mnode v1, mnode v2)
mnode ReplaceSymbols_ (mnode f, mnode m)
mnode Pass_ ()
mnode NoOp_ ()
mnode Info_ (mnode n)
mnode Break_ ()
mnode Continue_ ()
mnode Super_ (mnode n1, mnode n2)
mnode Unite_ (mnode v)
mnode Unite_ (mnode v1, mnode v2)
mnode Unite_ (mnode v1, mnode v2, mnode outer)
mnode Union_ (mnode v1, mnode v2)
mnode Intersect_ (mnode v1, mnode v2)
mnode Intersect_ (mnode v1, mnode v2, mnode outer)
mnode Intersection_ (mnode v1, mnode v2)
mnode ComplementA_ (mnode v1, mnode v2)
mnode Complement_ (mnode v1, mnode v2)
mnode SubsumesData_ (mnode v1, mnode v2)
mnode Range_ (mnode end)
mnode Range_ (mnode start, mnode end)
mnode Range_ (mnode start, mnode end, mnode increment)
mnode ListRange_ (mnode end)
mnode ListRange_ (mnode start, mnode end)
mnode ListRange_ (mnode start, mnode end, mnode increment)
mnode Finish_ ()
mnode Finish_ (mnode value)
mnode SymToStr_ (mnode sym)
mnode StrToSym_ (mnode str)

Static Public Member Functions

static bool isStandardType (const mstr &type)

Static Public Attributes

static const ClassIdType ClassId

Friends

class MObject_

Detailed Description

Provides the M interpreter, storing/restoring objects, cues, distributed objects, and more.

MObject implements the M interpreter and the essential functions associated with it. M is a language based on functional programming principles which is both that which is processed by the M interpreter directly and at the same time, the basis of the AST (abstract syntax tree) used by the parsers and generators. All M functions begin in upper-case e.g: Add(), Def() -- some M functions evaluate their arguments while others are lazy or may perform partial evaluation, e.g: symbol lookup. Each MObject is effectively an interpreter with state allowing M methods/functions and attributes to be defined within. MObject also provides an interface that supports storing/restoring objects, cues, and distributed functionality. Throughout the documentation, we refer to the client-side of a distributed object as a "remote object." And the server-side as the "distributed object." MObject is fully storeable/restoreable.


Member Enumeration Documentation

The attribute modes used for manipulating attributes.

Raw - set/retrieve directly by value.

Exists - same as Raw but throw an MError when attribute does not exist.

TryProtected - Try to manipulate the value through an accessor or mutator e.g: getX(), setX(value), falling back to raw mode if such a method does not exist.

TryProtectedExists - same as TryProtected but throws an MError when attribute does not exist.

Protected - manipulation must go through an accessor or mutator. If such a method does not exist, an MError is thrown.


Constructor & Destructor Documentation

Meta::MObject::MObject ( bool  basic = false  ) 

Constructor.

Parameters:
basic true if this is a basic object. See MBasicObject.
Meta::MObject::MObject ( MBrokerBase broker  ) 

Constructor that subclasses call to create a remote object.

Meta::MObject::MObject ( const MObject object  ) 

Copy constructor.

Meta::MObject::MObject ( const mvar v,
RestoreOpt  opt 
)

Restore constructor.

virtual Meta::MObject::~MObject (  )  [virtual]

Destructor.


Member Function Documentation

mnode Meta::MObject::Abs_ ( mnode  v  ) 

Absolute value.

mnode Meta::MObject::ACos_ ( mnode  v  ) 

Arcosine.

mnode Meta::MObject::Add_ ( mnode  v1,
mnode  v2 
)

Addition.

mnode Meta::MObject::AddA_ ( mnode  v1,
mnode  v2 
)

Add to, i.e: +=

mnode Meta::MObject::Alt_ ( mnode  v1,
mnode  v2 
)

Alternative value: if v1 is defined v1 else v2.

mnode Meta::MObject::AltA_ ( mnode  v1,
mnode  v2 
)

Alternative value: if v1 is defined this function is a no-op, else set to v1 to v2.

mnode Meta::MObject::And_ ( mnode  n1,
mnode  n2 
)

Logical AND with short-circuiting.

mnode Meta::MObject::Args_ ( mnode  f  ) 

Evaluate the arguments of function f.

mnode Meta::MObject::ASin_ ( mnode  v  ) 

Arcsine.

mnode Meta::MObject::ATan2_ ( mnode  y,
mnode  x 
)

Arctangent 2.

mnode Meta::MObject::ATan_ ( mnode  v  ) 

Arctangent.

mnode Meta::MObject::attribute ( size_t  i  ) 

Get the i-th attribute.

Returns:
mnull on failure.
mnode Meta::MObject::attribute ( const mstr name,
AttributeMode  mode = Raw 
)

Get the named attribute.

Returns:
mnull on failure.
size_t Meta::MObject::attributeCount (  )  const
Returns:
A count of all attributes.
mstr Meta::MObject::attributeName ( size_t  i  )  const

Get the name of the i-th attribute.

Returns:
Empty string on failure.
mnode Meta::MObject::Attrs_ (  ) 
Returns:
All attributes in scope.
mnode Meta::MObject::Back_ ( mnode  n  ) 

Return the last item in n's sequence or function arguments.

mnode Meta::MObject::Break_ (  ) 

Break.

MBrokerBase* Meta::MObject::broker (  ) 
Returns:
This object's broker, or null if no broker.
mnode Meta::MObject::Call_ ( mnode  f  ) 

Perform a call, evaluating function f's arguments first.

mnode Meta::MObject::Catalan_ (  ) 

High precision Catalan constant.

mnode Meta::MObject::Ceil_ ( mnode  v  ) 

Ceiling function.

mnode Meta::MObject::CEval_ ( mnode  n1,
mnode  n2 
)

Used for evaluation at the compilation/parsing stage.

mnode Meta::MObject::CEval_ ( mnode  n  ) 

Used for evaluation at the compilation/parsing stage.

mnode Meta::MObject::Class_ ( mnode  n1,
mnode  n2 
)

Declare a class.

const mstr& Meta::MObject::className (  )  const

Get this object's class name.

mnode Meta::MObject::Clear_ ( mnode  v  ) 

Functional version of MVar::clear().

void Meta::MObject::clearCues ( MObject receiver  ) 

Remove all cues this object has mappings for involving receiver.

void Meta::MObject::clearCues (  ) 

Remove all cues this object has mappings for.

mnode Meta::MObject::ClearMap_ ( mnode  v  ) 

Functional version of MVar::clearMap().

void Meta::MObject::clearReceiveCues ( MObject emitter  ) 

Remove all cues from the specified emitter in which this object is the target.

void Meta::MObject::clearReceiveCues (  ) 

Remove all cues (from other objects) in which this object as receiver.

mnode Meta::MObject::ClearSeq_ ( mnode  v  ) 

Functional version of MVar::clearSeq().

virtual MObject* Meta::MObject::clone (  )  const [virtual]
Returns:
A copy of this object.

Reimplemented in Meta::MAgent, Meta::MMLEntity, and Meta::MRandom.

mnode Meta::MObject::Clone_ ( mnode  n  ) 

Copy an object.

mnode Meta::MObject::Cls_ ( mnode  n  ) 

A closure, when evaluated n is returned.

mnode Meta::MObject::CodeData_ ( mnode  n  ) 

Used to specifiy code which is to be treated as data and not executed.

mnode Meta::MObject::Complement_ ( mnode  v1,
mnode  v2 
)

Return the result of applying ComplementA to v1 and v2.

mnode Meta::MObject::ComplementA_ ( mnode  v1,
mnode  v2 
)

Functional version of MVar::complement().

void Meta::MObject::connectCue ( mnode  source,
MObject receiver 
)

Similar to connectCue(3), this convenience method may be called when source function is identical to target function.

void Meta::MObject::connectCue ( mnode  source,
MObject receiver,
mnode  target 
)

Connect a cue emitted by this object to a receiver.

Parameters:
source The source function e.g: update(a)
receiver The object to receive the cue.
target The target function for the receive to interpret, which may remap any of the source parameters. e.g: redraw("now",a).
mnode Meta::MObject::Continue_ (  ) 

Continue.

mnode Meta::MObject::Copy_ ( mnode  n  ) 
Returns:
A copy of the node n.
mnode Meta::MObject::Cos_ ( mnode  v  ) 

Cosine.

mnode Meta::MObject::CosH_ ( mnode  v  ) 

Hyperboic cosine.

mnode Meta::MObject::Create_ ( mnode  n  ) 

Create a new object with managed memory deallocation.

mnode Meta::MObject::Dec_ ( mnode  v  ) 

Pre-decrement.

mnode Meta::MObject::DecP_ ( mnode  v  ) 

Post-decrement.

mnode Meta::MObject::Def_ ( mnode  scope,
mnode  s,
mnode  v 
)

Identical to Def(2), but define within specified scope.

e.g: Def(Global,x,10)

mnode Meta::MObject::Def_ ( mnode  s,
mnode  v 
)

Lazy definition (v is not evaluated), used for defining a function or aliasing a symbol to a function.

e.g: Def(diff(a,b),Sub(a,b))

mnode Meta::MObject::Delete_ ( mnode  n  ) 

Delete an object.

mnode Meta::MObject::Div_ ( mnode  v1,
mnode  v2 
)

Division.

mnode Meta::MObject::DivA_ ( mnode  v1,
mnode  v2 
)

Divide by, i.e: /=

mnode Meta::MObject::Elem_ ( mnode  n,
mnode  ni 
)

Extract an element from a node, e.g: Elem(Add(1,2),0) => 1

void Meta::MObject::emitCue ( mnode  f  ) 

Emit a cue, using the source/target mappings defined by connectCue().

Parameters:
f e.g: update(0)
void Meta::MObject::enableInterrupts ( bool  flag  ) 

Set whether this object periodically checks interrupts. See MInterrupt. For performance reasons, the default is not to check for interrupts.

mnode Meta::MObject::Eq_ ( mnode  v1,
mnode  v2 
)

Equal to.

mnode Meta::MObject::Erase_ ( mnode  v,
mnode  k 
)

Functional version of MVar::erase().

mnode Meta::MObject::Euler_ (  ) 

High precision Euler constant.

mvar Meta::MObject::eval ( const mvar code  ) 

Process code data at the head of an mvar. If the result contains symbolic data, it is converted to code data and returned.

mnode Meta::MObject::Eval_ ( mnode  n  ) 

Evaluate n.

mnode Meta::MObject::Ex_ ( mnode  n  ) 

Execute n.

mnode Meta::MObject::Exp_ ( mnode  v  ) 

Exponential function.

mnode Meta::MObject::Expand_ ( mnode  n  ) 

Expand a function containing Range() functions.

mnode Meta::MObject::Find_ ( mnode  n1,
mnode  n2 
)

Find a node within another node.

mnode Meta::MObject::Finish_ ( mnode  value  ) 

Finish used to stop execution in various contexts.

mnode Meta::MObject::Finish_ (  ) 

Finish used to stop execution in various contexts.

mnode Meta::MObject::Flatten_ ( mnode  n1  ) 

Perform the inverse of LRec() and RRec().

mnode Meta::MObject::Floor_ ( mnode  v  ) 

Floor function.

mnode Meta::MObject::For_ ( mnode  n1,
mnode  n2,
mnode  n3,
mnode  n4 
)

For loop.

mnode Meta::MObject::ForEach_ ( mnode  item,
mnode  sequence,
mnode  block 
)

Foreach loop.

mnode Meta::MObject::Functions_ (  ) 
Returns:
All functions in scope.
mnode Meta::MObject::GE_ ( mnode  v1,
mnode  v2 
)

Greater than or equal to.

mnode Meta::MObject::Get_ ( mnode  n,
mnode  nk 
)

Index n with nk, creating the entry at nk if it doesn't exist.

mnode Meta::MObject::Get_ ( mnode  n  ) 

Get a symbol value or function defintion from scope.

mnode Meta::MObject::GetI_ ( mnode  s  ) 

Get a symbol from the immediate scope.

mnode Meta::MObject::GT_ ( mnode  v1,
mnode  v2 
)

Greater than.

mnode Meta::MObject::HasKey_ ( mnode  v,
mnode  k 
)

Functional version of MVar::hasKey().

mnode Meta::MObject::Head_ ( mnode  n  ) 

Head, e.g: Head(Neg(1)) => "Neg" or the head of an mvar.

mnode Meta::MObject::Idx_ ( mnode  n,
mnode  nk 
)

Index n at nk, nk must be a valid key or an MError is thrown.

mnode Meta::MObject::If_ ( mnode  n1,
mnode  n2,
mnode  n3 
)

Conditional, if-then-else.

mnode Meta::MObject::If_ ( mnode  n1,
mnode  n2 
)

Conditional, if-then.

mnode Meta::MObject::Import_ ( mnode  n  ) 

Import library functions.

mnode Meta::MObject::Inc_ ( mnode  v  ) 

Pre-increment.

mnode Meta::MObject::IncP_ ( mnode  v  ) 

Post-increment.

mnode Meta::MObject::Index_ ( mnode  v,
mnode  x,
mnode  start,
mnode  end 
)

Functional version of MVar::index().

mnode Meta::MObject::Index_ ( mnode  v,
mnode  x,
mnode  start 
)

Functional version of MVar::index().

mnode Meta::MObject::Index_ ( mnode  v,
mnode  x 
)

Functional version of MVar::index().

mnode Meta::MObject::IndexMap_ ( mnode  v,
mnode  flag 
)

Functional version of MVar::indexMap().

mnode Meta::MObject::Info_ ( mnode  n  ) 

Info embeds information in M code which is ignored by the interpreter.

virtual bool Meta::MObject::instanceOf ( ClassIdType  classId  )  const [virtual]
Returns:
true if this object is an instance of the specified class id. A unique class id may be assigned with MFactory::allocateClassId();

Reimplemented in Meta::MMLEntity, and Meta::MScope.

mnode Meta::MObject::Intersect_ ( mnode  v1,
mnode  v2,
mnode  outer 
)

Functional version of MVar::intersect().

mnode Meta::MObject::Intersect_ ( mnode  v1,
mnode  v2 
)

Functional version of MVar::intersect().

mnode Meta::MObject::Intersection_ ( mnode  v1,
mnode  v2 
)
Returns:
v1 and v2 Intersected.
mnode Meta::MObject::Inv_ ( mnode  v  ) 

Inverse.

bool Meta::MObject::inVirtual (  ) 
Returns:
true if this object is in the process of a virtual call.
bool Meta::MObject::isBasic (  )  const
Returns:
true if this is a basic object. See MBasicObject.
bool Meta::MObject::isConnected (  )  const

Called on the client-side of a distributed object.

Returns:
true If the object is currently connected to a distributed object.
mnode Meta::MObject::IsConstant_ ( mnode  n  ) 
Returns:
true if n is non-symbolic.
mnode Meta::MObject::IsDefined_ ( mnode  v  ) 

Functional version of MVar::isDefined().

bool Meta::MObject::isDistributed (  )  const
Returns:
true if this a server-side distributed object.
mnode Meta::MObject::IsEmpty_ ( mnode  v  ) 

Functional version of MVar::isEmpty().

bool Meta::MObject::isExact (  )  const
Returns:
true if object is currently using exact math.
mnode Meta::MObject::IsFalse_ ( mnode  n  ) 
Returns:
true if n is False proper (as opposed to numeric true).
mnode Meta::MObject::IsFunction_ ( mnode  n  ) 
Returns:
true if n is a function.
bool Meta::MObject::isLocal (  )  const
Returns:
true if the connected client resides on localhost.
mnode Meta::MObject::IsNumeric_ ( mnode  n  ) 
Returns:
true if n is numeric.
bool Meta::MObject::isRemote (  )  const
Returns:
true if this a client-side (remote) distributed object.
static bool Meta::MObject::isStandardType ( const mstr type  )  [static]
Returns:
true if type refers to a standard M type, e.g: "double", "mvar"
bool Meta::MObject::isStrict (  )  const
Returns:
true if this interpreter is running in strict mode.
mnode Meta::MObject::IsString_ ( mnode  n  ) 
Returns:
true if n is a string.
mnode Meta::MObject::IsSymbol_ ( mnode  n  ) 
Returns:
true if n is a symbol.
mnode Meta::MObject::IsTrue_ ( mnode  n  ) 
Returns:
true if n is True proper (as opposed to numeric true).
mnode Meta::MObject::Itp_ ( mnode  s,
mnode  si 
)

Interpolate values in si into string s.

mnode Meta::MObject::Join_ ( mnode  v,
mnode  delimiter 
)

Functional version of MVar::join().

mnode Meta::MObject::Keys_ ( mnode  v  ) 

Functional version of MVar::keys().

mnode Meta::MObject::Lambda_ ( mnode  n1,
mnode  n2,
mnode  n3 
)

Define a lambda function.

mnode Meta::MObject::LE_ ( mnode  v1,
mnode  v2 
)

Less than or equal to.

mnode Meta::MObject::Len_ ( mnode  n  ) 

Return the length/size of n.

mnode Meta::MObject::ListRange_ ( mnode  start,
mnode  end,
mnode  increment 
)

Functional version of MMath::listRange().

mnode Meta::MObject::ListRange_ ( mnode  start,
mnode  end 
)

Functional version of MMath::listRange().

mnode Meta::MObject::ListRange_ ( mnode  end  ) 

Functional version of MMath::listRange().

bool Meta::MObject::lock ( const MTime timeout  ) 

Lock the object's general-purpose mutex with timeout.

Returns:
true on success.
void Meta::MObject::lock (  ) 

Lock the object's general-purpose mutex.

mnode Meta::MObject::Log10_ ( mnode  v  ) 

Logarithm base 10.

mnode Meta::MObject::Log_ ( mnode  n  ) 

Log, same as Print() but with a newline appended.

mnode Meta::MObject::LogE_ ( mnode  v  ) 

Logarithm base e.

mnode Meta::MObject::LRec_ ( mnode  n,
mnode  k,
mnode  all 
)

Use left-recursion to convert n to k-arity nested functions.

mnode Meta::MObject::LRec_ ( mnode  n  ) 

Use left-recursion to convert n to nested binary functions, e.g: Add(1,2,3) => Add(Add(1,2),3)

mnode Meta::MObject::LT_ ( mnode  v1,
mnode  v2 
)

Less than.

mnode Meta::MObject::Match_ ( mnode  n1,
mnode  n2 
)

Pattern matching.

mnode Meta::MObject::Max_ ( mnode  v1,
mnode  v2 
)

Max value.

mnode Meta::MObject::MCode_ ( mnode  n  ) 

Used to specifiy embedded raw M code.

mnode Meta::MObject::Merge_ ( mnode  v1,
mnode  v2 
)

Functional version of MVar::merge().

mnode Meta::MObject::MergeScope_ ( mnode  s1,
mnode  s2 
)

Merge scopes.

mnode Meta::MObject::method ( size_t  i  ) 
Returns:
The i-th M method or mnull on failure.
mnode Meta::MObject::method ( const mstr name,
size_t  inputs 
)
Returns:
The M method with the specified signature or mnull on failure.
mnode Meta::MObject::Method_ ( mnode  n1,
mnode  n2,
mnode  n3 
)

Declare a method.

size_t Meta::MObject::methodCount (  )  const
Returns:
A count of the number of M methods.
mnode Meta::MObject::Methods_ (  ) 
Returns:
All methods in scope.
mnode Meta::MObject::MGet_ ( mnode  s  ) 

Resolve a symbol which may be recursively defined.

mnode Meta::MObject::Min_ ( mnode  v1,
mnode  v2 
)

Min value.

mnode Meta::MObject::Mod_ ( mnode  v1,
mnode  v2 
)

Modulus.

mnode Meta::MObject::ModA_ ( mnode  v1,
mnode  v2 
)

Modulus by, i.e: =

mnode Meta::MObject::Mul_ ( mnode  v1,
mnode  v2 
)

Multiplication.

mnode Meta::MObject::MulA_ ( mnode  v1,
mnode  v2 
)

Multiply by, i.e: *=

mnode Meta::MObject::NE_ ( mnode  v1,
mnode  v2 
)

Not equal to.

mnode Meta::MObject::Neg_ ( mnode  v  ) 

Negation.

mnode Meta::MObject::New_ ( mnode  n  ) 

Construct a new object.

mnode Meta::MObject::NoOp_ (  ) 

A no-op, which may be erased from the M code.

mnode Meta::MObject::Not_ ( mnode  n  ) 

Logical negation.

mnode Meta::MObject::Once_ ( mnode  f  ) 

Used to execute a function f once, leaving behind the value as evaluated.

virtual void Meta::MObject::onClientClosed ( const mvar session  )  [virtual]

Called on the server-side of a distributed object when a connection to client is closed.

Parameters:
session The session data associated with the client.
virtual void Meta::MObject::onServerClosed (  )  [virtual]

Called on the client-side of a distributed object when the connection to server is closed.

mnode Meta::MObject::Or_ ( mnode  n1,
mnode  n2 
)

Logical OR with short-circuiting.

mnode Meta::MObject::OuterMergeScope_ ( mnode  s1,
mnode  s2 
)

Outer merge scope (s2's symbols/functions take precedence).

mnode Meta::MObject::Param_ ( mnode  n  ) 

Typically called when n is a parameter passed to a function to be partially evaluated, e.g: for symbol lookup.

mnode Meta::MObject::Params_ ( mnode  f  ) 

Partial evalation of parameters in f.

mnode Meta::MObject::Pass_ (  ) 

A no-op placeholder.

mnode Meta::MObject::Pi_ (  ) 

High precision constant pi.

mnode Meta::MObject::Pop_ ( mnode  v  ) 

Functional version of MVar::pop().

mnode Meta::MObject::PopBack_ ( mnode  v  ) 

Functional version of MVar::popBack().

mnode Meta::MObject::PopFront_ ( mnode  v  ) 

Functional version of MVar::popFront().

mnode Meta::MObject::PopScope_ (  ) 

Pop a scope from the current call stack.

mnode Meta::MObject::Pow_ ( mnode  v1,
mnode  v2 
)

Exponentiation.

mnode Meta::MObject::PreEval_ ( mnode  n1,
mnode  n2 
)

Pre-evaluate functions selectively.

mnode Meta::MObject::Print_ ( mnode  n  ) 

Print.

virtual mnode Meta::MObject::process ( mnode  n,
uint32_t  flags = 0 
) [virtual]
mnode Meta::MObject::Push_ ( mnode  v,
mnode  x 
)

Functional version of MVar::push().

mnode Meta::MObject::PushBack_ ( mnode  v,
mnode  x 
)

Functional version of MVar::pushBack().

mnode Meta::MObject::PushFront_ ( mnode  v,
mnode  x 
)

Functional version of MVar::pushFront().

mnode Meta::MObject::PushScope_ ( mnode  s  ) 

Push scope s onto the current call stack.

mnode Meta::MObject::Range_ ( mnode  start,
mnode  end,
mnode  increment 
)

Functional version of MMath::vectorRange().

mnode Meta::MObject::Range_ ( mnode  start,
mnode  end 
)

Functional version of MMath::vectorRange().

mnode Meta::MObject::Range_ ( mnode  end  ) 

Functional version of MMath::vectorRange().

mnode Meta::MObject::Real_ ( mnode  r  ) 

Construct a real number.

mnode Meta::MObject::ReDef_ ( mnode  s,
mnode  v 
)

Redefine a symbol or function. Redefines the first matching symbol or function on the stack.

bool Meta::MObject::release (  ) 

From the client-side, release a remote object.

mnode Meta::MObject::remoteProcess ( mnode  f,
bool  block = true,
mnode  fail = 0 
)

If this is a remote object (checked through isRemote()) then dispatch a request through a broker to process a method on the server-side of the object.

Parameters:
block false in order to not wait for the response.
fail The node to return upon failure, e.g: if a disconnect occurs during processing.
mnode Meta::MObject::ReplaceSymbols_ ( mnode  f,
mnode  m 
)

Replace symbols in f with those mapped in m.

mnode Meta::MObject::Reset_ (  ) 

Reset the interpreter, clearing all state.

mnode Meta::MObject::ResetGlobal_ (  ) 

Reset the global scope and other global state.

mnode Meta::MObject::Ret_ ( mnode  n  ) 

Return a value.

mnode Meta::MObject::Round_ ( mnode  v,
mnode  precision 
)

Round to specfied precision.

mnode Meta::MObject::Round_ ( mnode  v  ) 

Round to nearest integer.

mnode Meta::MObject::RRec_ ( mnode  n,
mnode  k,
mnode  all 
)

Use right-recursion to convert n to k-arity nested functions/

mnode Meta::MObject::RRec_ ( mnode  n  ) 

Use right-recursion to convert n to nested binary functions, e.g: Add(1,2,3) => Add(1,Add(2,3))

MScope* Meta::MObject::scope (  ) 
Returns:
This object's M scope.
mnode Meta::MObject::Scope_ ( mnode  s,
mnode  f 
)

Execute f from within scope s.

mnode Meta::MObject::Scope_ ( mnode  s  ) 

Get or create a named scope.

mnode Meta::MObject::Scope_ (  ) 
Returns:
The current scope.
mnode Meta::MObject::Scoped_ ( mnode  f  ) 

Execute f from within a new scope pushed onto the call stack.

const mvar& Meta::MObject::session (  )  const

Called on the server-side of a distributed object.

Returns:
The session data associated with the current client's request.
mvar& Meta::MObject::session (  ) 

Called on the server-side of a distributed object.

Returns:
The session data associated with this connection.
mnode Meta::MObject::Set_ ( mnode  n,
mnode  v 
)

Set n's value to value v.

void Meta::MObject::setAttribute ( const mstr name,
mnode  n,
AttributeMode  mode = Raw 
)

Set the named attribute.

void Meta::MObject::setClassName ( const mstr name  ) 

Set this object's class name. This is done automatically for MFactory-constructed objects.

void Meta::MObject::setExact ( bool  flag  ) 

Set whether the interpreter uses exact math rather than returning floating point approximations (in some cases), e.g: an exact interpreter returns Sqrt(2) when Sqrt(2) is requested while non-exact mode would return 1.41421. The initial behavior of the object is to use non-exact math.

void Meta::MObject::setMethod ( mnode  sig,
mnode  body 
)
Returns:
Set an M method.
Parameters:
sig e.g: sum(a,b)
body e.g: Ret(Add(a,b,))
void Meta::MObject::setStrict ( bool  flag  ) 

Set whether to enable strict interpretation (default is true). Strict interpreters throw an MProcessError when they attempt to process an undefined symbol or function. Non-strict interpreters leave it untouched, returning the unknown symbol or function.

mnode Meta::MObject::Show_ ( mnode  s  ) 

Show the unevaluated value of a symbol.

mnode Meta::MObject::Sin_ ( mnode  v  ) 

Sine.

mnode Meta::MObject::SinH_ ( mnode  v  ) 

Hyperboic sine.

mnode Meta::MObject::Size_ ( mnode  v  ) 

Functional version of MVar::size().

mnode Meta::MObject::Split_ ( mnode  v,
mnode  delimiter 
)

Functional version of MVar::split().

mnode Meta::MObject::Split_ ( mnode  v,
mnode  delimiter,
mnode  maxTokens 
)

Functional version of MVar::split().

mnode Meta::MObject::Sqrt_ ( mnode  v  ) 

Square root.

virtual void Meta::MObject::store ( mvar v  )  const [virtual]
mnode Meta::MObject::StrToSym_ ( mnode  str  ) 
Returns:
String str converted to a symbol.
mnode Meta::MObject::Sub_ ( mnode  v1,
mnode  v2 
)

Subtraction.

mnode Meta::MObject::SubA_ ( mnode  v1,
mnode  v2 
)

Subtract from, i.e: -=

mnode Meta::MObject::SubsumesData_ ( mnode  v1,
mnode  v2 
)

Return true if v1's data subsumes v2.

mnode Meta::MObject::Super_ ( mnode  n1,
mnode  n2 
)

Execute a super-class method.

mnode Meta::MObject::Symbols_ (  ) 
Returns:
All symbols in scope.
mnode Meta::MObject::SymToStr_ ( mnode  sym  ) 
Returns:
Symbol sym converted to a string.
mnode Meta::MObject::Tan_ ( mnode  v  ) 

Tangent.

mnode Meta::MObject::TanH_ ( mnode  v  ) 

Hyperboic tangent.

mnode Meta::MObject::Throw_ ( mnode  n,
mnode  msg,
mnode  type 
)

Throw an MError with the specified type and message. Node n contains the filename/line number.

mnode Meta::MObject::Throw_ ( mnode  n,
mnode  msg 
)

Throw an MError with specified message. Node n contains the filename/line number.

bool Meta::MObject::tryLock (  ) 

Attempt to lock the object's general-purpose mutex.

Returns:
true on success.
mnode Meta::MObject::Type_ ( mnode  n1,
mnode  n2,
mnode  n3,
mnode  n4 
)

Construct a type with initial value.

mnode Meta::MObject::Type_ ( mnode  n1,
mnode  n2,
mnode  n3 
)

Construct a type.

mnode Meta::MObject::Undef_ ( mnode  n  ) 

Undefine n from scope.

mnode Meta::MObject::Union_ ( mnode  v1,
mnode  v2 
)
Returns:
v1 and v2 United.
mnode Meta::MObject::Unite_ ( mnode  v1,
mnode  v2,
mnode  outer 
)

Functional version of MVar::unite().

mnode Meta::MObject::Unite_ ( mnode  v1,
mnode  v2 
)

Functional version of MVar::unite().

mnode Meta::MObject::Unite_ ( mnode  v  ) 

Functional version of MVar::unite().

void Meta::MObject::unlock (  ) 

Unlock the object's general-purpose mutex.

mnode Meta::MObject::Value_ ( mnode  n1,
mnode  n2,
mnode  n3 
)

Return a typed value.

mnode Meta::MObject::While_ ( mnode  n1,
mnode  n2 
)

While loop.

mnode Meta::MObject::XOr_ ( mnode  n1,
mnode  n2 
)

Logical exclusive-OR with short-circuiting.


The documentation for this class was generated from the following file:

Generated on Wed Mar 24 16:22:42 2010 for AndroMeta by  doxygen 1.6.1