Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

more::lang::location Class Reference

A lazily resolved value. More...

#include <more/lang/package.h>

Inheritance diagram for more::lang::location:

Inheritance graph
[legend]
Collaboration diagram for more::lang::location:

Collaboration graph
[legend]
List of all members.

Public Methods


Detailed Description

A lazily resolved value.

This has low space overhead (two pointers) most stuff goes into the handler. Lookup is fast after the value is resolved, but resolving the value may be slow.


Constructor & Destructor Documentation

more::lang::location::location   [inline]
 

Construct an undefined location.

The only valid methods for an undefined location are is_defined(), set(void*) and set_resolver().

more::lang::location::location resolver   handler,
void *    ptr = 0
[explicit]
 

Construct a location handled by handler or containing ptr.

If ptr is non-zero, handler will not be used by location, so it is safe to set it to 0 as long as set is not invoked with a 0 argument.

more::lang::location::~location  
 


Member Function Documentation

void more::lang::location::call void *    ret,
void **    args
 

If the value is a function, call it, otherwise screw up the process.

In some frameworks this may be equivalent to using ct_proto::call on this->get(). This method is provided in order to allow an interpreted code.

void* more::lang::location::get   const [inline]
 

Returns a pointer to the object of the binding.

The cx_package_variable resovler will invalidate the returned pointer upon re-linking, which may be caused by another call to this method.

Precondition:
Either the location is fixed or a resolver is provided.

void* more::lang::location::get_if_ready   const [inline]
 

Returns a pointer to the object if it no computaiton is needed.

resolver* more::lang::location::get_resolver   const [inline]
 

Return the handler of this location.

bool more::lang::location::is_defined   const [inline]
 

True if the location is fixed or if a resolver is provided.

void more::lang::location::set void *    ptr [inline]
 

To be called from reslove() to set to pointer to the object.

void more::lang::location::set_resolver resolver   h [inline]
 

Set the handler.

ct_type const* more::lang::location::type_of   const [inline]
 

Return the type of the data at this location.

Precondition:
A resolver is provided.


The documentation for this class was generated from the following file:
Generated on Sat Sep 7 19:12:54 2002 for more with Doxygen 1.2.13.1. Doxygen 1.2.13.1 is written and copyright 1997-2002 by Dimitri van Heesch.