2018-03-13 23:22:17 +01:00
|
|
|
/*
|
|
|
|
* This file is a part of morm
|
|
|
|
* and is distributed under the 2-Clause BSD licence.
|
|
|
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2023-04-12 17:20:29 +02:00
|
|
|
* Copyright (c) 2018-2023, Tomasz Sowa
|
2018-03-13 23:22:17 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
|
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-06-30 13:28:38 +02:00
|
|
|
#ifndef headerfile_morm_src_flatconnector
|
|
|
|
#define headerfile_morm_src_flatconnector
|
2018-03-13 23:22:17 +01:00
|
|
|
|
|
|
|
#include "textstream/textstream.h"
|
2023-04-12 17:20:29 +02:00
|
|
|
#include "export.h"
|
2018-03-13 23:22:17 +01:00
|
|
|
|
|
|
|
|
|
|
|
namespace morm
|
|
|
|
{
|
2018-03-23 20:26:57 +01:00
|
|
|
class Model;
|
2018-07-05 11:51:26 +02:00
|
|
|
class FlatExpression;
|
2018-03-23 20:26:57 +01:00
|
|
|
|
2018-03-13 23:22:17 +01:00
|
|
|
|
2018-03-23 20:26:57 +01:00
|
|
|
class FlatConnector
|
2018-03-13 23:22:17 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2018-03-23 20:26:57 +01:00
|
|
|
FlatConnector();
|
|
|
|
virtual ~FlatConnector();
|
2018-03-13 23:22:17 +01:00
|
|
|
|
2023-04-12 17:20:29 +02:00
|
|
|
virtual void to_text(pt::TextStream & stream, Model & model, Export exp);
|
2018-03-23 20:26:57 +01:00
|
|
|
virtual void set_expression(FlatExpression & expression);
|
|
|
|
virtual FlatExpression * get_expression();
|
2018-03-13 23:22:17 +01:00
|
|
|
|
2018-03-23 20:26:57 +01:00
|
|
|
protected:
|
2018-03-13 23:22:17 +01:00
|
|
|
|
2018-03-23 20:26:57 +01:00
|
|
|
FlatExpression * flat_expression;
|
|
|
|
bool expression_allocated;
|
2018-03-13 23:22:17 +01:00
|
|
|
|
2018-03-23 20:26:57 +01:00
|
|
|
virtual void allocate_default_expression() = 0;
|
|
|
|
virtual void allocate_default_expression_if_needed();
|
|
|
|
virtual void deallocate_expression();
|
|
|
|
|
|
|
|
};
|
2018-03-13 23:22:17 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|