overridemethods : output

Output the block to the stream.

Any other method of any other object can call this method. This is called 'public' access.

The data-type returned is "voidtype";

This method is contained in the object "overridemethods".

The method takes the following arguments:

filedef : Pointer to tgl_structure_parser

Not sure.

obj : Pointer to @schemaobj

Not sure.

This method is overridden from an abstract method with the same signature found in the object @block.

Implementations

C++

The files "../cppxmlobj/reflect/jscript_object_navigator.hpp", "schema/schema_method.hpp" and "tgl_block_parser.hpp" are included.

Find any methods that need to be overridden.

	xmlobj::xmlobj *o = obj;
	if (_location != "")
	{
		ph::reflect::jscript_object_navigator n(obj->root(), filedef->console(), false, false);
		ph::common::object_base *no = n.navigate(o, _location);
		if (!no)
		{
			filedef->error("Could not find location [" + _location + "] in object.");
			return;
		}
		o = dynamic_cast<xmlobj::xmlobj *>(no);
		if (!o)
		{
			filedef->error("Internal error. How could the object returned not be an xmlobj?.");
			return;
		}
	}
	
	ph::xmlobj::xmlobj_typed_vector<ph::tools::schema::schema_method> *v = 
		dynamic_cast<ph::xmlobj::xmlobj_typed_vector<ph::tools::schema::schema_method> *>(
			o->get_composite_object("methods"));
	if (!v)
	{
		filedef->error("No composite member 'methods'.");
		return;
	}
		
	// loop through all of the methods
	for (ph::xmlobj::xmlobj_typed_vector<ph::tools::schema::schema_method>::iterator i=v->begin();
			i != v->end(); i++)
	{
		// skip over those objects that don't match if matchname is on.
		if (o != obj && _matchname)
			if (i->name() != obj->name())
				continue;
				
		if (i->get("inheritance") == "override")
		{
			// search back for the parent class whcih implements
			// this same name as an abstract method, and then use the source
			// for that, except without the "=0".
			ph::tools::schema::schema_method *impl = 0;
			xmlobj *parent = dynamic_cast<xmlobj *>(o->parent());
			while (!impl && parent)
			{	
				impl = find_method(parent, i->name());
				if (!impl)
					parent = dynamic_cast<xmlobj *>(parent->parent());
			}
			
			if (impl)
			{
				tgl_block_parser parser(this, impl, false, false, filedef);
				if (!parser.write_output(_structure))
				{
					filedef->error("Could not process blocks.");
					return;
				}
			}
			else
			{
				std::string err = "Could not find overriden method '" + i->name() + "' as abstract.";
				filedef->error(err);
				return;
			}
		}
	}

Generated: Wed Apr 5 23:56:19 EST 2006 using "xsltproc ... docbook.xsl". Copyright (c) 2003, 2004, 2005; Paul Hamilton; pHamtec P/L. Use, modification, and distribution is provided free of any limitations.