/*
 *  The contents of this file are subject to the Initial
 *  Developer's Public License Version 1.0 (the "License");
 *  you may not use this file except in compliance with the
 *  License. You may obtain a copy of the License at
 *  http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
 *
 *  Software distributed under the License is distributed AS IS,
 *  WITHOUT WARRANTY OF ANY KIND, either express or implied.
 *  See the License for the specific language governing rights
 *  and limitations under the License.
 *
 *  The Original Code was created by Adriano dos Santos Fernandes.
 *
 *  Copyright (c) 2014 Adriano dos Santos Fernandes <adrianosf at gmail.com>
 *  and all contributors signed below.
 *
 *  All Rights Reserved.
 *  Contributor(s): ______________________________________.
 */

//// TODO: test structs

// Base for all interfaces.
interface Disposable
{
	void dispose();
}

/* Status is the *exception* class. */
[exception]
interface Status : Disposable
{
	const int ERROR_1 = 1;
	const int ERROR_2 = 0x2;
	const int ERROR_12 = ERROR_1 | ERROR_2;

	int getCode() const;
	void setCode(int code);
}

interface Factory : Disposable
{
	Status createStatus();
	Calculator createCalculator(Status status);
	Calculator2 createCalculator2(Status status);
	Calculator createBrokenCalculator(Status status);
}

interface Calculator : Disposable
{
	int sum(Status status, int n1, int n2) const;

version:
	[notImplemented(Status::ERROR_1)] int getMemory() const;
	void setMemory(int n);

version:
	void sumAndStore(Status status, int n1, int n2);
}

interface Calculator2 : Calculator
{
	int multiply(Status status, int n1, int n2) const;
	void copyMemory(const Calculator calculator);

version:
	void copyMemory2(const int* address);
}
