lowlevellibsandfws/pluginfw/Test_Bed/DefaultLogOutputTest/DefaultLogOutputStateAccessor.h
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // The definition of the accessor class upon the CDefaultLogOutput
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __DEFAULTLOGOUTPUTSTATEACCESSOR_H__
       
    19 #define __DEFAULTLOGOUTPUTSTATEACCESSOR_H__
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <f32file.h>
       
    23 #include <s32stor.h>
       
    24 #include <s32file.h>
       
    25 
       
    26 #include "TestUtilities.h"
       
    27 #include <ecom/test_bed/testbeddefinitions.h>
       
    28 #include "StateAccessor.h"
       
    29 #include "DefaultLogOutput.h"
       
    30 
       
    31 // ______________________________________________________________________________
       
    32 //
       
    33 /**
       
    34 	@internalComponent
       
    35 	
       
    36 	Comments : State accessor for the CDefaultLogOutput object under test.
       
    37  */
       
    38 class TDefaultLogOutput_StateAccessor : public MStateAccessor
       
    39 	{
       
    40 public:
       
    41 	/**
       
    42 		@fn				InvariantTest(TAny* aTestObject)
       
    43 		Intended Usage	:	
       
    44 		@since			7.0
       
    45 		@param			TAny* A pointer to the object under test.
       
    46 		@return			TInt KErrNone if the invariants were valid, error code otherwise.
       
    47 		@pre 			TDefaultLogOutput_StateAccessor is fully constructed.
       
    48 		@post			The class under test is set to the state specified.
       
    49 	 */
       
    50 	inline TInt InvariantTest(TAny* aTestObject);
       
    51 
       
    52 	/**
       
    53 		@fn				Internalize(TAny* aTestObject)
       
    54 		Intended Usage	: Implemented by the developer to set the state of the object under test.
       
    55 		@since			7.0
       
    56 		@param			aTestObject The object to be tested
       
    57 		@return			KErrNone if the internalize was successful.
       
    58 		@return			One of the EPOC standard error codes indicating the reason
       
    59 						for the failure	to load the object state.
       
    60 		@pre 			TDefaultLogOutput_StateAccessor is fully constructed, and
       
    61 						valid test object must be passed in.
       
    62 		@post			The class under test is set to the state specified
       
    63 	 */
       
    64 	inline virtual TInt Internalize(TAny* aTestObject);
       
    65 
       
    66 	/**
       
    67 		@fn				Externalize(TAny* aTestObject)
       
    68 		Intended Usage	: Implemented by the developer to persist the state of the object under test.
       
    69 		@since			7.0
       
    70 		@param			aTestObject The object to be tested
       
    71 		@return			KErrNone if the internalize was successful.
       
    72 		@return			One of the EPOC standard error codes indicating the reason
       
    73 						for the failure	to externalize the object.
       
    74 		@pre 			TDefaultLogOutput_StateAccessor is fully constructed, and
       
    75 						valid test object must be passed in.
       
    76 		@post			Returns an error code dependant on the result of the test
       
    77 	 */
       
    78 	inline virtual TInt Externalize(TAny* aTestObject);
       
    79 
       
    80 	/**
       
    81 		@fn				InternalizeL(RFileReadStream& aStream, CDefaultLogOutput* aDefaultLogOutput)
       
    82 		Intended Usage	: Implemented by the developer to set the state of the object under test.
       
    83 		Error Condition	: Leaves with an error code.
       
    84 		@since			7.0
       
    85 		@param			aStream The filestream to read from .
       
    86 		@param			aDefaultLogOutput A pointer to the CDefaultLogOutput object under test.
       
    87 		@return			None.
       
    88 		@pre 			TDefaultLogOutput_StateAccessor is fully constructed.
       
    89 		@post			The class under test is set to the state specified.
       
    90 	 */
       
    91 		inline void InternalizeL(RFileReadStream& aStream, CDefaultLogOutput* aDefaultLogOutput);
       
    92 
       
    93 	/**
       
    94 		@fn				ExternalizeL(RFileWriteStream& aStream, CDefaultLogOutput* aDefaultLogOutput)
       
    95 		Intended Usage	: Implemented by the developer to persist the state of the object under test.
       
    96 		Error Condition	: Leaves with an error code.
       
    97 		@since			7.0
       
    98 		@param			aStream The filestream to persist into.
       
    99 		@param			aDefaultLogOutput A pointer to the CDefaultLogOutput object under test.
       
   100 		@return			None.
       
   101 		@pre 			TDefaultLogOutput_StateAccessor is fully constructed.
       
   102 		@post			No change to the class under test, its internal state.
       
   103 						is persisted.
       
   104 	*/
       
   105 	inline void ExternalizeL(RFileWriteStream& aStream, CDefaultLogOutput* aDefaultLogOutput);
       
   106 
       
   107 private:
       
   108 	/**
       
   109 		@fn				InternalizeL(CDefaultLogOutput* aDefaultLogOutput)
       
   110 		Intended Usage	: Implemented by the developer to set the state of the object under test.
       
   111 		Error Condition	: Leaves with an error code.
       
   112 		@since			7.0
       
   113 		@param			TAny* A pointer to the object under test.
       
   114 		@return			None.
       
   115 		@pre 			TDefaultLogOutput_StateAccessor is fully constructed.
       
   116 		@post			The class under test is set to the state specified.
       
   117 	*/
       
   118 	inline void InternalizeL(CDefaultLogOutput* aDefaultLogOutput);
       
   119 
       
   120 	/**
       
   121 		@fn				ExternalizeL(CDefaultLogOutput* aDefaultLogOutput)
       
   122 		Intended Usage	: Implemented by the developer to persist the state of the object under test.
       
   123 		Error Condition	: Leaves with an error code.
       
   124 		@since			7.0
       
   125 		@param			TAny* A pointer to the object under test.
       
   126 		@return			None.
       
   127 		@pre 			TDefaultLogOutput_StateAccessor is fully constructed.
       
   128 		@post			No change to the class under test, its internal state.
       
   129 						is persisted.
       
   130 	*/
       
   131 	inline void ExternalizeL(CDefaultLogOutput* aDefaultLogOutput);
       
   132 	};	// TDefaultLogOutput_StateAccessor
       
   133 
       
   134 #include "DefaultLogOutputStateAccessor.inl"
       
   135 
       
   136 #endif // __DEFAULTLOGOUTPUTSTATEACCESSOR_H__
       
   137