summaryrefslogtreecommitdiff
path: root/formula/inc/formula/token.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'formula/inc/formula/token.hxx')
-rw-r--r--formula/inc/formula/token.hxx24
1 files changed, 18 insertions, 6 deletions
diff --git a/formula/inc/formula/token.hxx b/formula/inc/formula/token.hxx
index be1b2f6acd..8937f844ae 100644
--- a/formula/inc/formula/token.hxx
+++ b/formula/inc/formula/token.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,13 +33,12 @@
#include <string.h>
#include <vector>
#include "formula/opcode.hxx"
-//#include "refdata.hxx"
-//#include "scmatrix.hxx"
-#include "formula/intruref.hxx"
#include <tools/mempool.hxx>
#include "formula/IFunctionDescription.hxx"
#include "formula/formuladllapi.h"
+#include <boost/intrusive_ptr.hpp>
+
namespace formula
{
@@ -86,9 +86,8 @@ typedef StackVarEnum StackVar;
class FormulaToken;
-typedef SimpleIntrusiveReference< class FormulaToken > FormulaTokenRef;
-typedef SimpleIntrusiveReference< const class FormulaToken > FormulaConstTokenRef;
-
+typedef ::boost::intrusive_ptr<FormulaToken> FormulaTokenRef;
+typedef ::boost::intrusive_ptr<const FormulaToken> FormulaConstTokenRef;
class FORMULA_DLLPUBLIC FormulaToken : public IFormulaToken
{
@@ -113,6 +112,7 @@ public:
inline StackVar GetType() const { return eType; }
BOOL IsFunction() const; // pure functions, no operators
BOOL IsMatrixFunction() const; // if a function _always_ returns a Matrix
+ bool IsExternalRef() const;
BYTE GetParamCount() const;
inline void IncRef() const { nRefCnt++; }
inline void DecRef() const
@@ -179,6 +179,16 @@ public:
{ return GetStrLenBytes( rStr.Len() ); }
};
+inline void intrusive_ptr_add_ref(const FormulaToken* p)
+{
+ p->IncRef();
+}
+
+inline void intrusive_ptr_release(const FormulaToken* p)
+{
+ p->DecRef();
+}
+
class FORMULA_DLLPUBLIC FormulaByteToken : public FormulaToken
{
private:
@@ -397,3 +407,5 @@ public:
// =============================================================================
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */