Skip to content

Commit

Permalink
fix minor typos
Browse files Browse the repository at this point in the history
  • Loading branch information
garfieldnate committed May 1, 2024
1 parent 06b02b6 commit 873fc7e
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 58 deletions.
42 changes: 21 additions & 21 deletions Core/ClientSML/src/sml_ClientTraceXML.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Date : March 2005
//
// This class is used to represent XML messages
// that contain trace output from a Soar.
// that contain trace output from a Soar command.
//
/////////////////////////////////////////////////////////////////

Expand All @@ -23,82 +23,82 @@ namespace sml
public:
// These methods provide access to specific attributes and tags without
// the client needing to pass in/know the strings. They're all very simple.

// Trace tag contains everything else
bool IsTagTrace() const ;

// Write commands on right hand side of productions generate output
// which are collected here.
bool IsTagRhsWrite() const ;
char const* GetString() const ;

// State tag attributes
bool IsTagState() const ;
char const* GetDecisionCycleCount() const ;
char const* GetStateID() const ;
char const* GetImpasseObject() const ;
char const* GetImpasseType() const ;
char const* GetStackLevel() const ;

// Operator tag attributes
bool IsTagOperator() const ;
char const* GetOperatorID() const ;
char const* GetOperatorName() const ;
// Included in tag, same as state
// char const* GetDecisionCycleCount() const ;

// Phase tag attributes
bool IsTagPhase() const ;
char const* GetPhaseName() const ;
char const* GetPhaseStatus() const ;
char const* GetFiringType() const ;
char const* GetLevelNum() const ; // SBW 8/4/08

// Subphase (firing productions/changing wm) tag
bool IsTagSubphase() const ;
bool IsSubphaseNameFiringProductions() const ;
bool IsSubphaseNameChangingWorkingMemory() const ;

// Firing-production tag, contains production
bool IsTagFiringProduction() const ;
bool IsTagRetractingProduction() const ;
bool IsTagLearning() const ;

// Production
bool IsTagProduction() const ;
char const* GetProductionName() const ;
char const* GetProductionDoc() const ;
char const* GetProductionType() const ;
char const* GetProductionDeclaredSupport() const ;

bool IsTagConditions() const ;
bool IsTagCondition() const ;
bool IsTagConjunctiveNegationCondition() const ;
bool IsTagActions() const ;
bool IsTagAction() const ;

// Condition attributes: Note this form allows for multiple unparsed conditions within the "condition" attribute.
char const* GetConditionTest() const ;
char const* GetConditionId() const ;
char const* GetCondition() const ;

// Action attributes
char const* GetActionId() const ;
char const* GetAction() const ;
char const* GetFunction() const ;

// Add-wme contains wme
bool IsTagAddWme() const ;
bool IsTagRemoveWme() const ;

// Wme tag attributes
bool IsTagWme() const ;
char const* GetWmeID() const ;
char const* GetWmeAttribute() const ;
char const* GetWmeValue() const ;
char const* GetWmeTimeTag() const ;
char const* GetWmePreference() const ;

// Preference tag
bool IsTagPreference() const ;
char const* GetPreferenceID() const ;
Expand All @@ -108,10 +108,10 @@ namespace sml
char const* GetPreferenceTimeTag() const ;
char const* GetPreferenceOSupported() const ;
char const* GetPreferenceReferent() const ;

// Marker between LHS matches and RHS results in trace
bool IsTagActionSideMarker() const ;

// Backtracing
bool IsTagLocal() const ;
bool IsTagLocals() const ;
Expand All @@ -121,25 +121,25 @@ namespace sml
bool IsTagOSKPreference() const ;
bool IsTagBacktraceResult() const ;
bool IsTagLocalNegation() const ;

char const* GetBacktraceAlreadyBacktraced() const ;
char const* GetBacktraceSymbol1() const ;
char const* GetBacktraceSymbol2() const ;

// Numeric indifferent preferences
bool IsTagCandidate() const ;
char const* GetCandidateName() const ;
char const* GetCandidateType() const ;
char const* GetCandidateValue() const ;
char const* GetCandidateExpValue() const ;

// Warnings, errors, messages and other tags
bool IsTagError() const ;
bool IsTagWarning() const ;
bool IsTagMessage() const ;
bool IsTagVerbose() const ;
} ;

} //closes namespace

#endif //SML_CLIENT_TRACE_XML_H
52 changes: 26 additions & 26 deletions Core/ClientSML/src/sml_ClientXML.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,33 @@ namespace sml

class Agent ;
class ClientTraceXML ;

class EXPORT ClientXML
{
friend class Agent ;

private:
soarxml::ElementXML* m_pElementXML ;

protected:
// This constructor is protected so that client doesn't try to build these objects.
// So far they're only built internally and then passed to the client.
// NOTE: We take ownership of the ElementXML object we are passed and
// delete it when this client object is deleted.
ClientXML(soarxml::ElementXML* pXML) ;

public:
ClientXML() ;
virtual ~ClientXML() ;

/*************************************************************
* @brief Creates a new reference to the underlying XML object.
*
* This allows a caller to "keep a copy" of an object they are
* passed.
*************************************************************/
ClientXML(ClientXML* pXML) ;

/*************************************************************
* @brief Cast this object to a subclass.
*
Expand All @@ -64,7 +64,7 @@ namespace sml
* to cast the underlying C++ object. These methods achieve that.
*
* NOTE: These methods always succeed because the subclasses contain no
* data. They just contain specific access method. So we can cast any
* data. They just contain specific access methods. So we can cast any
* XML message over to any of these subclasses and if it's not a match
* when we ask for IsTagX() etc they'll just return false.
* If the subclasses contained data we'd want this to be a dynamic cast
Expand All @@ -76,14 +76,14 @@ namespace sml
{
return (ClientTraceXML*) this ;
}

/*************************************************************
* @brief Gets the tag name for this element.
*
* @returns The tag name.
*************************************************************/
char const* GetTagName() const ;

/*************************************************************
* @brief Returns true if the tag name matches.
*
Expand All @@ -92,12 +92,12 @@ namespace sml
* @returns true if equal (case sensitive)
*************************************************************/
bool IsTag(char const* pTagName) const ;

/*************************************************************
* @brief Returns the number of children of this element.
*************************************************************/
int GetNumberChildren() const ;

/*************************************************************
* @brief Returns the n-th child of this element by placing it in pChild.
*
Expand All @@ -111,35 +111,35 @@ namespace sml
* @returns false if index is out of range.
*************************************************************/
bool GetChild(ClientXML* pChild, int index) const ;

/*************************************************************
* @brief Get the number of attributes attached to this element.
*************************************************************/
int GetNumberAttributes() const ;

/*************************************************************
* @brief Get the name of the n-th attribute of this element.
* Attributes may not be returned in the order they were added.
*
* @param index The 0-based index of the attribute to return.
*************************************************************/
const char* GetAttributeName(int index) const ;

/*************************************************************
* @brief Get the value of the n-th attribute of this element.
*
* @param index The 0-based index of the attribute to return.
*************************************************************/
const char* GetAttributeValue(int index) const ;

/*************************************************************
* @brief Get the value of the named attribute of this element.
*
* @param attName The name of the attribute to look up.
* @returns The value of the named attribute (or null if this attribute doesn't exist).
*************************************************************/
const char* GetAttribute(const char* attName) const ;

/*************************************************************
* @brief Get the character data for this element.
*
Expand All @@ -148,13 +148,13 @@ namespace sml
* It will include the original special characters (e.g. "<").
*************************************************************/
char const* GetCharacterData() const ;

/*************************************************************
* @brief Returns true if the character data should be treated as a binary buffer
* rather than a null-terminated character string.
*************************************************************/
bool IsCharacterDataBinary() const ;

/*************************************************************
* @brief Converts a character data buffer into binary data.
*
Expand All @@ -173,15 +173,15 @@ namespace sml
* @returns True if buffer is binary after conversion.
*************************************************************/
bool ConvertCharacterDataToBinary() ;

/*************************************************************
* @brief Returns the length of the character data.
*
* If the data is a binary buffer this is the size of that buffer.
* If the data is a null terminated string this is the length of the string + 1 (for the null).
*************************************************************/
int GetCharacterDataLength() const ;

/*************************************************************
* @brief Converts the XML object to a string.
*
Expand All @@ -191,37 +191,37 @@ namespace sml
* @returns The string form of the object.
*************************************************************/
char* GenerateXMLString(bool includeChildren, bool insertNewLines = false) const ;

/*************************************************************
* @brief Returns the length of string needed to represent this object (does not include the trailing null, so add one for that)
*
* @param includeChildren Includes all children in the XML output.
* @param insertNewlines Add newlines to space out the tags to be more human-readable
*************************************************************/
int DetermineXMLStringLength(bool includeChildren, bool insertNewLines = false) const ;

/*************************************************************
* @brief Utility function to allocate memory that the client will pass to the other ElementXML functions.
*
* @param length The length is the number of characters in the string, so length+1 bytes will be allocated
* (so that a trailing null is always included). Thus passing length 0 is valid and will allocate a single byte.
*************************************************************/
static char* AllocateString(int length) ;

/*************************************************************
* @brief Utility function to release memory allocated by this element and returned to the caller.
*
* @param string The string to release. Passing NULL is valid and does nothing.
*************************************************************/
static void DeleteString(char* pString) ;

/*************************************************************
* @brief Performs an allocation and then copies the contents of the passed in string to the newly allocated string.
*
* @param string The string to copy. Passing NULL is valid and returns NULL.
*************************************************************/
static char* CopyString(char const* original) ;

/*************************************************************
* @brief Performs an allocation and then copies the contents of the passed in buffer to the newly allocated buffer.
* You need to use this rather than copyString if copying binary data (because it can contained embedded nulls).
Expand All @@ -231,7 +231,7 @@ namespace sml
*************************************************************/
static char* CopyBuffer(char const* original, int length) ;
} ;

} //closes namespace

#endif //SML_CLIENT_XML_H
Loading

0 comments on commit 873fc7e

Please sign in to comment.