Use shared_ptr and references for Actions.
This slows terminal emulation slightly.
This commit is contained in:
@@ -50,8 +50,8 @@ namespace Parser {
|
||||
public:
|
||||
void setfamily( StateFamily *s_family ) { family = s_family; }
|
||||
Transition input( wchar_t ch ) const;
|
||||
virtual Action *enter( void ) const { return new Ignore; }
|
||||
virtual Action *exit( void ) const { return new Ignore; }
|
||||
virtual ActionPointer enter( void ) const { return shared::make_shared< Ignore >(); }
|
||||
virtual ActionPointer exit( void ) const { return shared::make_shared< Ignore >(); }
|
||||
|
||||
State() : family( NULL ) {};
|
||||
virtual ~State() {};
|
||||
@@ -65,7 +65,7 @@ namespace Parser {
|
||||
};
|
||||
|
||||
class Escape : public State {
|
||||
Action *enter( void ) const;
|
||||
ActionPointer enter( void ) const;
|
||||
Transition input_state_rule( wchar_t ch ) const;
|
||||
};
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Parser {
|
||||
};
|
||||
|
||||
class CSI_Entry : public State {
|
||||
Action *enter( void ) const;
|
||||
ActionPointer enter( void ) const;
|
||||
Transition input_state_rule( wchar_t ch ) const;
|
||||
};
|
||||
class CSI_Param : public State {
|
||||
@@ -88,7 +88,7 @@ namespace Parser {
|
||||
};
|
||||
|
||||
class DCS_Entry : public State {
|
||||
Action *enter( void ) const;
|
||||
ActionPointer enter( void ) const;
|
||||
Transition input_state_rule( wchar_t ch ) const;
|
||||
};
|
||||
class DCS_Param : public State {
|
||||
@@ -98,18 +98,18 @@ namespace Parser {
|
||||
Transition input_state_rule( wchar_t ch ) const;
|
||||
};
|
||||
class DCS_Passthrough : public State {
|
||||
Action *enter( void ) const;
|
||||
ActionPointer enter( void ) const;
|
||||
Transition input_state_rule( wchar_t ch ) const;
|
||||
Action *exit( void ) const;
|
||||
ActionPointer exit( void ) const;
|
||||
};
|
||||
class DCS_Ignore : public State {
|
||||
Transition input_state_rule( wchar_t ch ) const;
|
||||
};
|
||||
|
||||
class OSC_String : public State {
|
||||
Action *enter( void ) const;
|
||||
ActionPointer enter( void ) const;
|
||||
Transition input_state_rule( wchar_t ch ) const;
|
||||
Action *exit( void ) const;
|
||||
ActionPointer exit( void ) const;
|
||||
};
|
||||
class SOS_PM_APC_String : public State {
|
||||
Transition input_state_rule( wchar_t ch ) const;
|
||||
|
||||
Reference in New Issue
Block a user