]> www.ginac.de Git - ginac.git/blobdiff - ginac/symbol.h
added example for namespace bracing
[ginac.git] / ginac / symbol.h
index 450a2df43deac6dec1f710e96662eec91ae4bc3b..0b6844a65d700a98706b104b5ce519a18a456797 100644 (file)
@@ -43,14 +43,11 @@ class symbol : public basic
 // types
        
        /** Symbols as keys to expressions - only for ginsh. */
-       class assigned_ex_info {
-               friend class ptr<assigned_ex_info>;
+       class assigned_ex_info : public refcounted {
        public:
-               assigned_ex_info();     ///< Default ctor
-               bool is_assigned;       ///< True if there is an expression assigned
-               ex assigned_expression; ///< The actual expression
-       private:
-               size_t refcount;        ///< Reference counter, managed by ptr<assigned_ex_info>
+               assigned_ex_info() throw();  ///< Default ctor
+               bool is_assigned;            ///< True if there is an expression assigned
+               ex assigned_expression;      ///< The actual expression
        };
 
 // member functions
@@ -58,7 +55,9 @@ class symbol : public basic
        // other constructors
 public:
        explicit symbol(const std::string & initname);
-       explicit symbol(const std::string & initname, const std::string & texname);
+       symbol(const std::string & initname, const std::string & texname);
+       symbol(const std::string & initname, unsigned rt, unsigned rtt);
+       symbol(const std::string & initname, const std::string & texname, unsigned rt, unsigned rtt);
        
        // functions overriding virtual functions from base classes
 public:
@@ -68,8 +67,10 @@ public:
        ex series(const relational & s, int order, unsigned options = 0) const;
        ex subs(const exmap & m, unsigned options = 0) const { return subs_one_level(m, options); } // overwrites basic::subs() for performance reasons
        ex normal(exmap & repl, exmap & rev_lookup, int level = 0) const;
-       ex to_rational(lst &repl_lst) const;
-       ex to_polynomial(lst &repl_lst) const;
+       ex to_rational(exmap & repl) const;
+       ex to_polynomial(exmap & repl) const;
+       unsigned return_type() const { return ret_type; }
+       unsigned return_type_tinfo() const { return ret_type_tinfo; }
 protected:
        ex derivative(const symbol & s) const;
        bool is_equal_same_type(const basic & other) const;
@@ -97,6 +98,8 @@ protected:
        unsigned serial;                 ///< unique serial number for comparison
        std::string name;                ///< printname of this symbol
        std::string TeX_name;            ///< LaTeX name of this symbol
+       unsigned ret_type;               ///< value returned by return_type()
+       unsigned ret_type_tinfo;         ///< value returned by return_type_tinfo()
 private:
        static unsigned next_serial;
 };